class TT extends Object
{
TT()
{
System.out.println("TT Class Default Constructor ");
}
protected void finalize()
{
System.out.println("TT Object Going to Dead....");
}
{
TT()
{
System.out.println("TT Class Default Constructor ");
}
protected void finalize()
{
System.out.println("TT Object Going to Dead....");
}
}
public class SystemClassDemo3 {
public static void main(String args[])
{
TT obj = new TT(); // Strong Reference
System.gc();
System.out.println("Now I am Going to Null the Obj ");
obj = null;
System.gc();
System.runFinalization();
}
}
public class SystemClassDemo3 {
public static void main(String args[])
{
TT obj = new TT(); // Strong Reference
System.gc();
System.out.println("Now I am Going to Null the Obj ");
obj = null;
System.gc();
System.runFinalization();
}
}
No comments:
Post a Comment