Garbage collection

mail@pastecode.io avatar
unknown
plain_text
6 months ago
302 B
4
Indexable
Never
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();
      
}
    
}
Leave a Comment