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

Applet draw a face , Write a Java Applet which will draw a face on applet a...

Write a Java Applet which will draw a face on applet as follows:   b)    Modify the program now by adding two Buttons (Java version of ActiveX Control) named Smily Fac

Write a function that draws a cow , Write a function that draws a cow at a ...

Write a function that draws a cow at a certain location on the screen, and use the function to draw a herd of cows

How to convert string value to number in java, How to convert string value ...

How to convert string value to number in java? While processing user input it is frequent essential to convert a String in which the user enters into an int . The syntax is

In which way java says write once run anywhere, Java says write once, run ...

Java says write once, run anywhere . In which ways this isn't quite applicable ?

Netbeans, how can i create an E-exam application on netbeans

how can i create an E-exam application on netbeans

What is a relational database, What is a Relational Database? Give the name...

What is a Relational Database? Give the names of any three RDBMS software? Database consist of two or more then two tables are called Relational database. Oracle dabatbase S

Fibonacci, Output first x values in the fibonacci sequence, where x is an a...

Output first x values in the fibonacci sequence, where x is an argument to the program. 0, 1, 1, 2, 3, 5, 8, ... Write the fibonacci creation function separate from the main func

Explain the three benefits of access protection, Explain the Three Benefits...

Explain the Three Benefits of Access Protection ? Access protection has three major benefits: 1. It permits you to enforce constraints on an object's state. 2. It gives a si

Difference between boolean & operator and && operator, How can we define th...

How can we define the difference between the Boolean & operator and the && operator ?

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