sample code finalize
package funds;
public class Special {
public static void main(String arg[])
{
String s=new String("java");
s=null;
System.gc(); //String finalize called
System.out.println("end of the main");
}
public void finalize()
{
System.out.println("finalize called");
}
}
output:
end of the main
0 comments:
Post a Comment