what are the differences between final,finally,finalize
methods?
Answer Posted / vibhor bhatnagar
Final :
final is a Modifier
final variable is a constant.
final method cann't be overrid.
final class cann't be subclassed.
Finally :
The finally clause is used to provide the capability to
execute code no matter whether or not an exception is
thrown or caught.
Finalize:
The purpose of finalization is to give an unreachable
object the opportunity to perform any cleanup processing
before the object is garbage collected. OR An object’s
finalize() method may only be invoked once by the garbage
collector.
| Is This Answer Correct ? | 15 Yes | 13 No |
Post New Answer View All Answers
Can you override private or static method in java?
What is garbage collector?
What is the destroy method?
Is void a keyword in java?
What is default exception handling in java?
What are the basic control structures?
What is the multi-catch block in java?
Does it matter in what order catch statements for filenotfoundexception and ioexception are written?
Is 0 a prime number?
Give us a program to check for parenthesis matching using stack.
How do you add an element to a hashset in java?
Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me
How would overload a function based on return type?
How can you traverse a linked list in java?
What do you understand by the bean persistent property?