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 do you mean by compiler?
What is Enum in Java?
What is pojo class in java?
List down the methods and interfaces of collection class in java.
Name four container classes.
What is the difference between a static and a non-static inner class in java programming?
Describe method overriding
What is numeric data type?
Is hashset sorted in java?
What is boolean data type in java?
Is int primitive data type?
I want to store more than 10 objects in a remote server? Which methodology will follow?
What are the two categories of data types in the java programming language?
Can we inherit a class with private constructor?
What is the definition of tree ?