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 boolean logic?
What is the purpose of the System class?
Is list thread safe in java?
What is ellipsis in java?
What environment variables are required to be set on a machine in order to run Java programs?
How many types of memory areas are allocated by jvm?
What is the purpose of sizeof operator?
How do you get the length of a string in java?
What is the benefit of singleton pattern?
What do you mean by hashing?
explain different ways of using thread? : Java thread
When do we use hashset over treeset?
What is the hashcode () and equals () used for?
What is a byte array?
What is gc()?