Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.logging.Level;
- import java.util.logging.Logger;
- public class Test {
- public static void main(String k[]) {
- SomeClass sc = new SomeClass();
- sc = null;
- System.gc();
- }
- }
- class SomeClass {
- public void finalize() {
- try {
- super.finalize();
- System.out.println("I'm being finalized");
- } catch (Throwable ex) {
- Logger.getLogger(SomeClass.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment