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
how to retrive data in one block from database by click data link in another block

What is linear search? It is the simplest form of search. It searches for the element sequentially starting from first element. This search has a drawback if element is located

(CarbonFootprint Interface: Polymorphism) Using interfaces, as you learned in this chapter, you can specify similar behaviors for possibly disparate classes. Governments and compan

Running a sample Java web application from the web get http 404 error

#questiongfjnkdfn..


Question: (a) Draw out a UML class diagram that captures the following information: An Employee is a kind of Person. An ATM is a kind of Machine. Both an Employee and an ATM

The problem statement is pretty simple. We need a software implementation of a Point of Sale terminal at a typical store. The users of the system are the cashiers sitting at the sa

Prepare a Java program to read .GPX files Project Description: Prepare a Java program (GPX_Tracks_to_Text.Java) for Windows to: - Read every .GPX file in a provide drive a

You are a newly recruited programmer, working for an IT company. This company won a contract to develop a Customer Relationship Management System (CRM) for a major retailer. The CR