The example aims to run an object finalization in Java.
Source Code
package com.beginner.examples;
public class RunOFExample {
public static void main(String[] args){
Runtime run = Runtime.getRuntime();
//garbage collect
run.runFinalization();
System.out.println("Object finalization is done!");
}
}
Output:
Object finalization is done!