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

Assignment Help:

 

 

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.

 


Related Discussions:- Basic difference b/w finalize(), final and finally in java

Explain choosing font faces and sizes in java awt packages, Explain Choosin...

Explain Choosing Font Faces and Sizes in java AWT packages? Choosing a font face is simple. First you create a new Font object. Then you call g.setFont(Font f). To instantiate

What is javaserver faces technology, A framework for building server-side u...

A framework for building server-side user interfaces for Web applications is written in the Java programming language.

Difference between static and non-static variable, What is the difference b...

What is the difference between static and non-static variables? A static variable is associated with the class as a whole rather than with specific instances of a class. Non-st

Explain the 4 phases of RUP?, 1. Inception : In the mean while the inc...

1. Inception : In the mean while the inception phase, you work out the business part for the project. You also will be creating a rough cost estimate and return on investment.

Need the following code for double variables instead of int, Need the follo...

Need the following code in double var instead of integer. import javax.swing.*; public class arrayVar { public static void main (String[] args) //This is our main method prompt

Write program for queue of cards, A Queue of Cards You are going to par...

A Queue of Cards You are going to parallel the development done in the lesson on inheritance where we constructed some base classes, StackNode and Stack, and derived  Floa

Write a program in javascript that will read in an xml file, Write a progra...

Write a program in Javascript that will read in an XML file. This file will contain details of devices maintained by the IT department of an organisation including an ID number, de

What is jsf life cycle and its phases, The series of steps followed by an a...

The series of steps followed by an application is known its life cycle. A JSF application typically follows six steps in its life. 1. Restore view phase 2. Apply request valu

Dialog window in Oracle by Java stored procedure, Is it possible to create ...

Is it possible to create any dialog window in Oracle in Java stored procedure?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd