Consider the following program :::
public class Manal {
static int m;
public int met() {
return this.m;
}
public Manal() {Manal.m ++ ;}
public static void main(
String s []) {
for(int lp = 0; lp< 100;lp++)
System.out.println(new Manal().met());
System.out.println("the no. of objects created r " + m);
}
}
can any1 pls tell me hw many objects r eligible for garbage collection when this program exit ...
i think 203 bcos ::
100 objects of Manal class
100 String objects from System.out.println(new Manal().met());
2 String objects ("the no. of objects created r " and other is toString(m) )
& 1 String frm System.out.println("the no. of objects created r " + m)
what do u say ....
manal