Garbage collection

Anonymous
plain_text
11/17/2023 4:16 PM
404 B
28
Indexable
public class GarbageCollection
{
    public void finalize()
    {
    System.out.println("garbage collection is successfully initiated");
    }

    public static void main(String[] args)
{
    GarbageCollection n1=new GarbageCollection();
    n1=null;
    System.gc();
      
}
    
}
Editor is loading...
Leave a Comment