Java Query

ce_neha

ce_neha

@ce-neha-RCoDQE Oct 25, 2024
Hi ,

----------------------------------------------
Given:-

class CB
{
Short st=200;
CB go(CB cb)
{
cb=null;
return cb;
}
public static void main(String[] ar)
{
CB c1=new CB();
CB c2=new CB();
CB c3=c1.go(c2);
c1=null;
// dostuff
}
}
------------------------------------------
Q. When //dostuff is reached,how amny objects are eligible for Garbage Collection?
please explain.

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform