Explain difference between final, finally and finalize?
Answer Posted / vijayakumar chinnnasamy
final:
final keyword can be applied to vairables,method,class.
fianl variable - You can't reassign/modify values to the
vaiables.
final class- You cannt extends(inherit) the class.
final method- You cannt override the final methods.
finally:
finally is used in try-catch (i.e exception handling in
java).
Each try contain only one finally blocks not more than
one.
There is no statement between catch block and try block.
It will be execute if exception is occure or not.
Mostly used for memeory release.
finalize:
This is method used to release the occupied memeory.
finally method must be protected or public otherwise
compile time error.
Is This Answer Correct ? | 74 Yes | 5 No |
Post New Answer View All Answers
What is java beans?
Is empty string in java?
What are the 6 mandatory procedures for iso 9001?
What do you mean by compiler?
How many bytes are there?
What 4 doubled?
if u open login & logout ,how can udisplay the timelogin & logout members ?
How do you make an arraylist empty in java?
What is udp in java?
String class is defined under which package in java?
Is java hard to learn?
Explain about automatic type conversion in java?
Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.
How to compare strings in java?
Is alive method in java?