SCJP1.4(91%)
scjp 1.4<br />challenge haven't limit!
SCJP1.4(91%)
scjp 1.4<br />challenge haven't limit!
Originally posted by ji dragon:
hi,Corey
if I change the modifier of the variable other into public,as follows:
the ans will be what? d?
pls!
SCJP 1.4
Originally posted by Corey McGlone:
but those references are from objects that can no longer be accessed.
Corey
scjp 1.4<br />challenge haven't limit!
Originally posted by Robert Skowronek:
> why?
Because after m1() method completed you have no reference to object of J class.
-> new J().m1();
In case were the code whould be:
J ref = new J().m1();
the correct answer should be d).
SCJP 1.4
scjp 1.4<br />challenge haven't limit!
Originally posted by ji dragon:
hi,John,
I am sorry I still not clear, what I can't understand is "[qb]The I objects hold references to each other, but as Corey explained, that does not prevent them from being garbage collected."
why? Since there are references for each of the created objects,why those references are from objects that can no longer be accessed.I think I can access them by reference for class I.eg:I ii=new I();I.other...
please explain it to me,thanx very much![/QB]
SCJP 1.4
scjp 1.4<br />challenge haven't limit!
Pradeep<br />Consultant - Enterprise Solutions,<br />Infosys Technologies Ltd,<br />Bangalore, India
Evildoers! Eat my justice! And this tiny ad's justice too!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|