class GC { static int count; GC() { count++; System.out.println(count+"Object Created"); } public static void main(String arg[]) { GC ob1=new GC(); GC ob2=new GC(); GC ob3=new GC(); { GC ob4=new GC(); } GC ob5=new GC(); ob5=ob1; System.gc(); } @Override protected void finalize() { count--; System.out.println(count); } }
27 September, 2020
NEXT ARTICLE
Next Post
PREVIOUS ARTICLE
Previous Post
NEXT ARTICLE
Next Post
PREVIOUS ARTICLE
Previous Post