Basic difference b/w finalize(), final and finally in java, JAVA Programming

 

 

1.   final - it is a constant declaration.

2.   finally - handles exception. The finally block is optional and gives a mechanism to clean up regardless of what occurs within the try block. Use the finally part to close files or to free other system resources like database statements, connections etc.

3.   finalize() - method performs in garbage collection. A method that is called before an object is discarded by the garbage collector, appearing it to clean up its state. Could not be need to release non-memory resources like sockets, file handles, database connections etc because Java has only a fix number of these resources and you do not know when the garbage collection is working to kick in to release these non-memory resources through the finalize() method.

 

Posted Date: 7/25/2012 2:25:11 AM | Location : United States







Related Discussions:- Basic difference b/w finalize(), final and finally in java, Assignment Help, Ask Question on Basic difference b/w finalize(), final and finally in java, Get Answer, Expert's Help, Basic difference b/w finalize(), final and finally in java Discussions

Write discussion on Basic difference b/w finalize(), final and finally in java
Your posts are moderated
Related Questions
RMI parameters : Primitive types are given by value. 2. References to remote objects are given as remote references that allow the client process to call methods on the rem

Your next task is to implement the MovieList class that manages the details for a list of DVD Movies read from the specified data file. The constructor will include a parameter tha

Develop Student Portal Project Description: Technology to be used: Java, Portlets, Liferay, functions in Oracle DB, Boostrap. We need develop two pages, a header and foote

Explain abstract method in java? Java permits methods and classes to be declared abstract. An abstract method is not actually implemented in the class. It is merely declared th

how to write a program to assign value of variable age and print if person is major.

The act of making associations between application components (beans) within the Spring container is reffered to as Bean wiring.

I need to know waht exactly is happining in the following code class Worker implements Runnable { DatagramSocket socket = null; DatagramPacket packet = null; public W

Extend the given drawing program (the version that allows undo and redo) as follows: a) Allow the user to select font and font size; user should also be able to boldface, underl

code for error correction and detection using even odd parity

EJBs are distributed elements, which need the RMI framework for object distribution. An EJB application server gives more services like object pooling, transaction management, data