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
Instructions Modify the program so that the computer will generate moves for the ‘O' player (it must continue to accept user input for ‘X'). A simple way to do this is to use a

How DoS attack is a cyber crime? For what cyber crime can be used? DoS stands for Decline of Service and it is a cyber crime as it jams and within a few cases shut down the goa

Write a brief note on each of the following. FTP Telnet Instant messaging VoIP FTP: File Transfer Protocol: This protocol is used to upload and download the

Need support Display TIFF in Internet Explorer without ActiveX plugin I would like to get a client side viewer designed that permits user to view TIFF files on IE 8 and IE 9 bro

Write a program called Drivers that displays information about Formula 1 drivers and their teams.     The program starts by prompting (asking) the user for the name of an input tex


Write a program called Power that displays the positive powers of 2. When the user enters the exponent at a prompt, the program displays 2 to that power. The program halts when the

The AOP module is used for developing aspects for our Spring-enabled application. Much of the support has been given by the AOP Alliance in order to ensure the interoperability amo

Want a graph database for relationship mapping of entities Project Description: I want a graph database for relationship mapping of entities, liable peoples. Also, the databa