aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes No. of Objects & Reference Variables Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "No. of Objects & Reference Variables" Watch "No. of Objects & Reference Variables" New topic
Author

No. of Objects & Reference Variables

srinivas jsv
Greenhorn

Joined: Jan 24, 2006
Posts: 1
How many Objects and Reference variable in the following snippet of code


Thing obj1 , obj2 , obj3; //Thing is class
obj1 = new Thing();
obj2 = obj1; //aliasing done here
steven gerrard
Ranch Hand

Joined: Jan 21, 2006
Posts: 55
i guess 1 object and 3 reference variables
cathymala louis
Ranch Hand

Joined: Nov 02, 2005
Posts: 77
I think One Object Three Reference Variable.
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 973
One object created by the new operator

3 reference variables of which 2 are pointing to the object created...
Chandrasekhar Mangipudi
Ranch Hand

Joined: Jan 29, 2006
Posts: 118
Originally posted by A Kumar:
One object created by the new operator

3 reference variables of which 2 are pointing to the object created...


Thanks & Regards,
ChandraSekharMangipudi
Maxwell Oyom
Greenhorn

Joined: Jan 18, 2006
Posts: 10
Three object references are declared. Two references then denote the same object. And the last referece is variable is not assigned to any object.


Divine 4 eva
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No. of Objects & Reference Variables
 
Similar Threads
about equals method?
Basic thread doubt
Circular references and garbage collection
islands of isolation(Garbage Collection)
passing parameters to a method.