Do the rules vary in any way when it concerns wrapper classes?I mean x,y are references to Integer objects right?Or do they just store the integer values?
Sun Certified Programmer for Java platform 1.4
Rahul
Originally posted by Rahul JG:
Cathy is right!!!
Mona(Varijasmom)
Sun Certified Programmer for Java platform 1.4
SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Sun Certified Programmer for Java platform 1.4
when sending a reference of an object as a parameter to a method, only a COPY of that reference is sent.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
But what about Integer Y in the program?
It is explicitely made null and the findout() method is not called using it.
Isn't it not eligible for garbage collection?
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
Then, when FindOut() was called the second time, would it create a new y or 'reuse' the y that was created previously?
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
...shouldn't it be 3 objects available for garbage collection?
I still need to trouble you. Sorry about that.
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
Sun Certified Programmer for Java platform 1.4
SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. - What truth? - That there is no spoon!!!