Explain and describe the this reference. How is the this reference used in each of the above methods?
What will be an ideal response?
this is a reserved word in Java. The reference to an object that is passed to any object's nonstatic method is called the this reference. Only nonstatic, instance methods have a this reference. For example, the two getEmpNum() methods for the Employee class perform identically. The first method simply uses the this reference without you being aware of it. The second method uses the this reference explicitly. Both methods return the empNum of the object used to call the method.
You might also like to view...
Write a conditional expression that will be true for all values of the variable x in the given range and false for all values outside the given range. Note that the variable x can take on any value, not just integer values.
Between 5 and 10 including end points
Although many authors use a more conversational style for email, users should remember that email messages often are forwarded to other recipients or groups,and so you must consider the users to whom it might be distributed.
Answer the following statement true (T) or false (F)