Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Harish Paravasthu
SCJP 1.5<br />SCWCD 1.4
Harish Paravasthu
Harish Paravasthu
SCJP 1.5<br />SCWCD 1.4
SCJP<br />SCJD
Originally posted by Harish Paravasthu:
public class Test{
public static void main(String[] args)
{
Object a = new Object();
// the object original referenced by object reference a
Object b = new Object();
Object c = new Object();
Object d = new Object();
d=c;
c=b;
b=a;
d=null;
}
}
A small change to the above code...here in this case,how many objects go into garbage collected???
i think only one object...
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
"If I want a group decision I'll look in a mirror" - Warren Buffett