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
Overall Requirements Every phone number is broken up into sections as shown below: Country Code Area Code Prefix Line Number 1 919 882 5000 Write a program to separate out a ph

Create an application for an animal-fur trimming service. The business is open 15 weeks of the year, from April through July. The fee for a small animal (under 6 pounds) is $100, a

Universal Android and iOS, Multipurpose Testing Application - Based on Phonegap Project Description: Universal Android and iOS, Multipurpose Testing Application Based on Phon

What do you mean about networking support in Java ?

I need Crime Management Project Description: It is a web based project build in Oracle(back end) and J2EE(front end)  for peoples so they will register complaints online.

A fictitious train company, 'Transrail', has commissioned you to write a program that manages a list of train tickets. The program should display a text menu that prompts the us

Describe the concept of Encapsulation  Encapsulation is a technique which is used for hiding properties and behaviors of an object and allowing outside access only as appropria

My java asignment is the following. Sorry if this is a repeat send. My email is Finding the largest object Write a method that returns the largest objects in an array of objects.

Java Server Pages (JSP) is a platform independent presentation layer technology that comes with SUN s J2EE platform. JSPs are normal HTML pages with Java code pieces embedded in th

pls telme source code for Padovan String