What is finalize() method?

What is finalize() method?

The finalize method is used to perform clean up operations. This method is always called by the Garbage collector when there are no more references to the object. It is called when clean up operations are performed on an object which will remove it from the memory.
Its syntax is:

protected void finalize throws Throwable{}

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.