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 are constants and how to create constants in java?
How many bits are in a sentence?
Differentiate between postfix and prefix operators in java.
Explain what do you mean by functional overloading in java?
What are the important features of Java 10 release?
Explain serialization and deserialization in java?
What do you know about the garbage collector?
When should I use a singleton?
Can we catch more than one exception in a single catch block?
How many static init can you have?
what do you understand by the term string with respect to java?
Is there a sort function in java?
What are jee technologies?
What about main() method in java ?
Where is the find and replace?