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
How can I right-justify a string?
What is ternary operator?
What is a numeric string?
What is meant by binding in rmi?
Why is logger singleton?
What is use of inner class in java?
What does 3 dots mean in java?
Can we use switch statement with strings?
What is meant by vector class, dictionary class, hash table class, and property class?
Can a method be overloaded based on different return type but same argument type?
What is update method called?
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
Explain about assignment statement?
What is getkey () in java?
What interface is extended by awt event listeners?