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
Difference between serialization and deserialization in java?
Which collection is best for sorting in java?
What does a boolean method return?
What are variable names?
What is the difference between yield() and sleep()?
What is the primary benefit of encapsulation?
What is use of static method?
How do you compare characters in java?
What is the purpose of java?
How does java pattern compile work?
Does treeset allow null in java?
What is a stringbuffer?
What is the benefit of inner classes in java?
What is string subsequence method?
How many functional interfaces does java 8 have?