Please clarify my doubt.
class A{
Long weight = 1000L;
}
public class B extends A{
public static void main (String[] args){
B b = new B();
B c = new B();
b = null;
c = null;//going to gc.
}
}
Here in the above code, while reaching "going to gc" how many objects are eligible for garbage collector? As far as i know args[], b, c and two Long objects totally 5 are eligible. But some says totally 4. They are saying that no two Long object will be created in heap but only one.
Please clarify my doubt.