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.


/*from w w  w .  ja  v  a  2 s  . c om*/
public class Main {

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




















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable