Home Answers Viewqa Java-Beginners referring to question Person..

 
 


mar
referring to question Person..
1 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners

View Answers

October 13, 2009 at 12:01 PM


Hi Friend,

If there is a need to to refer to instance of the class from its method,then you can use this keyword.It avoids name confliction.

this.matricNo=matricNo;
this.name=name;
this.date=date;
this.gender=gender;

In the above code this.matricNo,this.name,this.date,this.gender refers to the instance variable matricNo,name,date,gender respectively.While matricNo,name,date,gender also refers to arguments passed to the constructor.

Thanks









Related Pages:
referring to question Person.. - Java Beginners
referring to question Person..  Hi!firstly i want to thank to someone...=gender; this is base on previous question (Person)..can u explain to me... sorry if this is a funny/stupid question..  Hi Friend
How to implement this superclass Person - Java Beginners
a superclass Person which it need to Make two classes, Student and Instructor, that inherit from Person. A person has a name and a year of birth. A student has a major...: /** This class tests the Person, Student, and Instructor classes. */ public
How to implement a superclass Person? - Java Beginners
How to implement a superclass Person?  How to implement a superclass Person. Make two classes, Student and Lecturer, that inherit from Person. A person has a name and year of birth. A student has a degree program and a lecturer
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
question
question   sir plz tell me what should i give in title box. just i want java program for the question typed in this area
Question
Question   When there is an exception in my program how java runtime system handles
question
question  dear sir/madam my question is how to compare two text format in java..we are java beginners..so we need the complete source code for above mentioned question...we have to compare each and every word
question
question  Dear sir i had some typing mistake at previous question so its my humble request to let me know the steps to start the tomcat6 under the tomcat directory
question
question  Gud morning sir, I have asked u some question regarding jsp in saturaday for that i didnot find any answere in which u send me the some of the links.U have asked me the specify some details. There is a entity name
Question?
Question?  My question is how to: Add a menu bar to the program with a File menu. In the File menu, add a submenu (JMenuItem) called About. When the user clicks on the About menu item, display a JOptionPane message dialog
help to write a program for biology to know if two person are related or not
help to write a program for biology to know if two person are related or not   I wrote the program and i want some help pleas this program check between if they are related or not . i have no problem of reading file and inserted

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.