Here is the answer.
Finalization is a function in Java which works on the object to perform the clearing process automatically.This is a built-in function and works in many tasks where it is needed to finish the processing. This means that if in Java coding provides the facility that one can assign value to the object so that the object clears the working area.
Java provides a method called finalize( ) that you can define for your class. Here s how it s supposed to work. When the garbage collector is ready to release the storage used for your object it will first call finalize( ) and only on the next garbage-collection pass will it reclaim the object s memory. So if you choose to use finalize( ) it gives you the ability to perform some important cleanup at the time of garbage collection.