Answer Posted / user
One scenario where final is important, when you want to prevent inheritance of a class, for security reasons. This allows you to make sure that code you are running cannot be overridden by someone.
The best example is
public final class String
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the static keyword?
What are the features of java?
Can one thread block the other thread?
What is a variable simple definition?
What does %4d mean in java?
Does java allow overriding static methods ?
What is the size of integer?
Explain the term virtual machine?
What are the differences between heap and stack memory in java?
What does exclamation mean in java?
How to declare objects of a class ?
What are the rules for variable declaration?
What is anti pattern in java?
How many bits is a string in java?
What is the ==?