Run object finalization using System class - Java Java Virtual Machine

Java examples for Java Virtual Machine:Utility

Description

Run object finalization using System class

Demo Code

 
public class Main {
 
        public static void main(String[] args) {
                 System.out.println("Suggesting JVM to run finalize method");
                 System.runFinalization();
                 System.out.println("Suggested JVM to run finalize method");
                 /* w  ww .j  ava 2 s  .  co  m*/
        }
}

Result


Related Tutorials