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 methodology can be employed to locate substrings inside a string?
What about static nested classes in java?
What is the difference between access specifiers and access modifiers in java?
What do you mean by singleton class in java?
what are the states associated in the thread? : Java thread
What does file separator do in java?
What is a loop java?
What is the purpose of the system class in java programming?
Can we overload the constructors?
Can we use static class instead of singleton?
What are the two types of java?
What is stringreader?
what is the significance of listiterator in java?
What modifiers may be used with a top-level class?
Are arrays primitive data types?