Java Data Type Tutorial - Java Object.finalize()








Syntax

Object.finalize() has the following syntax.

protected void finalize()   throws Throwable

Example

In the following code shows how to use Object.finalize() method.


public class Main {

  public static void main(String[] args) throws Throwable {
    Main cal = new Main();
    cal.finalize();
  }
}