public class GarbageCollection {
public static void main(String[] args)
{
GarbageCollection gb= new GarbageCollection();
GarbageCollection gb2=method1(gb);
GarbageCollection gb4=new GarbageCollection();
gb2=gb4;/*line 4*/
somethinsgsillogical();
}
static void somethinsgsillogical() {
// TODO Auto-generated method stub
}
static GarbageCollection method1(GarbageCollection mgb)
{
mgb=new GarbageCollection();
return mgb;
}
}
Is the program logical? If yes kindly sate that After line 4, how many objects are eligible for garbage collection