Explain difference between final, finally and finalize?
Answers were Sorted based on User's Feedback
final keyword can be applied to vairables,method,class.
fianl variable - You can't reassign/modify values to the
final class- You cannt extends(inherit) the class.
final method- You cannt override the final methods.
finally is used in try-catch (i.e exception handling in
Each try contain only one finally blocks not more than
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.
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|
Answer / ranganathkini
When a class is marked final, it cannot be subclassed. When
a method is marked final, it cannot be overridden by the
subclass. And when a field is marked final, its value once
set, cannot be reset.
finally is the last clause in a try...catch block. It is a
block of statements that is executed irrespective if or if
not an exception was caught in the preceding try block.
finalize is a reserved method in Java, which can be
overridden by classes containing code to release any
expensive resources being held to by the object. Expensive
resources include, native peer objects, file/device/database
|Is This Answer Correct ?||64 Yes||13 No|
Answer / mukund viswanath vyavhare
Final -it is keyword .It is use for
variables and method.
Finally-it is use to define a block
that is always executed in try
catch and finally stetment.
|Is This Answer Correct ?||11 Yes||7 No|
How do you check whether the list is empty or not in java?
If you do not want your class to be inherited by any other class. What would you do?
What is an empirical question?
1).Is Object class abstract or not? 2).Is main method(public static void main(String args)low priority thread or high priority thread?
What is data type modifier?
Explain differences between checked and unchecked exceptions in java?
What does int argc char * argv  mean?
How is rounding performed under integer division?
What is jagged array in java?
Explain how can you debug the Java code?
What is string made of?
What is the difference between stringbuffer and stringbuilder?