Here is my code snippet where i am using a final object reference..
public class FinalTest{
private int rollNo;
public static void main(String[] args){
final FinalTest obj = new FinalTest();
obj.rollNo=20;
obj.rollNo=30;
System.out.println(obj.rollNo);
obj = null;
}
}
and finally i am assigning null to the reference variable obj.. but java does not allow this. so i want to know in such case ( when we don't assign null to our object reference obj) when does this obj will become eligible for garbage collection.