waltermilner

Untitled

May 13th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. import java.util.logging.Level;
  2. import java.util.logging.Logger;
  3.  
  4. public class Test {
  5.  
  6.     public static void main(String k[]) {
  7.         SomeClass sc = new SomeClass();
  8.         sc = null;
  9.         System.gc();
  10.  
  11.     }
  12. }
  13.  
  14. class SomeClass {
  15.  
  16.     public void finalize() {
  17.         try {
  18.             super.finalize();
  19.             System.out.println("I'm being finalized");
  20.         } catch (Throwable ex) {
  21.             Logger.getLogger(SomeClass.class.getName()).log(Level.SEVERE, null, ex);
  22.         }
  23.  
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment