GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java-Work/Question25.java at master · Animesh-Ghosh/Java-Work Expand file tree/ Copy pathQuestion25.javaMore file actions 23 lines (21 loc) · 588 Bytes / Copy pathQuestion25.javaFile metadata and controls23 lines (21 loc) · 588 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 // program to demonstrate garbage collector class GarbageC { public void finalize () { System.out.println ("Garbage Collector invoked."); } } class Question25 { public static void main (String[] args) { GarbageC obj = new GarbageC (); String string = new String ("ABC"); System.gc (); System.out.println ("Dereferencing GarbageC object."); obj = null; System.gc (); /* finalize () invoked whenever CPU got time cuz low-priority that's why output might be inconsistent */ System.out.println ("Dereferencing String object."); string = null; System.gc (); } } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |