Showing posts with label FINALIZE. Show all posts
Showing posts with label FINALIZE. Show all posts

Wednesday, 22 January 2014

The Object class in java

what are the methods define object in java

The object class:


There is one special class, Object, defined by Java. All other classes are subclasses of Object.That is, Objectis a superclass of all other classes. This means that a reference variable of type Object can refer to an object of any other class. Also, since arrays are implemented as classes,a variable of type Object can also refer to any array.

Monday, 20 January 2014

Using finalize() method in java

The finalize() method:


finalize method in java is a special method much like main method in java. finalize() is called before Garbage collector reclaim the Object, its last chance for any object to perform cleanup activity i.e. releasing any system resources held, closing connection if open etc.The intent is for finalize() to release system resources such as open files or open sockets before getting collected.