This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes refrences Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "refrences" Watch "refrences" New topic
Author

refrences

Arnb Sen
Ranch Hand

Joined: Feb 23, 2004
Posts: 145


Output is cat. Initially I thought the output was dog.

My reason :

"b = a" means b points to wherever a points. So after statement a = new String("dog");, a points to "dog" and hence, b should also point to "dog". Thus, after "c = b", c should point to "dog".

After the output I think :

"b = a" means b points to where a currently points. If later a points somewhere else, it does not change where b points.

Is this correct ?


Regards,<br />Arnab
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

You got it!


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Arnb Sen
Ranch Hand

Joined: Feb 23, 2004
Posts: 145
Hi Michael,

Thanks for the confirmation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: refrences
 
jQuery in Action, 3rd edition