|
What is the output of this program? A good answer might be:
The two variables refer to different objects | |
AliasIt is possible to have two (or more) reference variables refer to the same object. Here is a modification to the program that does that:
Only one object has been created (because there is only one new operator.) The second statement:
copies the reference that is in pointA into the reference variable pointB.
Now both reference variables lead to the same object.
alias When two or more reference variables refer to the same object, each variable is said to be an alias. | |
QUESTION 19:What is the output of the program? Click Here after you have answered the question |