Finalizer Method in Java

FINALIZER METHODS:

We have seen that a constructor method is used to initialize an object when it is declared. This process is known as initialization. similarly,java supports a concept called finilization,which is just opposite to initialization.we know that java run-time is an automatic garbage collecting system.it automatically frees up the memory resources used by the objects,but objects may hold another non object resources such as file descriptors or window system fonts,the garbage collector cannot free these resources.in order to free these resources we must use a finalizer method. 

The finalizer method is simply finalize( ) and can be added to any class,java calls that method whenever it is about to reclaim the space for that object.

Related

Java 558340869853094664

Post a Comment

emo-but-icon

item