Explain final, finalize() and finally?
Answer Posted / venkataramana
final is a keyword.
we can use the final keyword in different context.
final keyword can be used with 1.Variables
2.Methods
3.Classes
When we use the final keyword with variables ,the value of
the final variable will not be changed i.e its value will be
fixed .
when we use the final keyword with methods, that is the
final method cannot be overridden.
when we use the final keyword with classes, that is the
final class cannot be extended to subclasses.
Finally() block is followed after try() or catch() block.
Finall() block executed even though if there the exception
having or not in the program.
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
What is binary tree in java?
What is the difference between hashmap and hashtable in java?
What is the difference between reader/writer and inputstream/output stream?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
Explain OOPs concept.
Why main method is static in java?
Do loops java?
Why multiple inheritance is not supported by java?
How to sort an array in java without using sort method?
What is the maximum size of hashmap in java?
What do you understand by soft reference?
What is a bubble sort in java?
how to run ecllipse with jettyserver for windows environment using batch file
Explain how to convert any java object into byte array.
what is the volatile modifier for? : Java thread