Explain final, finalize() and finally?
Answer Posted / sunil
final variable is a constant.
final method cann't be overrid.
final class cann't be subclassed.
finally is a block usually used to release all the
resources utilized inside the try block such as to free
resources like stream objects, to close sockets .The code
in finally block is guaranteed of execution
irrespective of occurrence of exception catched/uncatched.
finalize() is never run more than once on any object.
finalize method is called by the garbage collector on an
object when the garbage collector determines that there are
no more references to the object.
Is This Answer Correct ? | 4 Yes | 11 No |
Post New Answer View All Answers
What is formatted output in java?
Explain what do you mean by functional overloading in java?
Why does java does not support multiple inheritance? Explain
What is an empty class? What functionality does it offer in Java?
How to do a true java ping from windows?
5 Coding best practices you learned in java?
What happens if an exception is throws from an object's destructor?
What is difference between null and void?
How to use arraylist in java netbeans?
Using callable statement how can you pass out parameters, explain with example?
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
Is static variable stored in heap?
What is abstraction in java?
Why constructor has no return type?
Write a program to print 15 random numbers using foreach of java 8?