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 hasnext in java?
What is java and their uses?
What is the biggest integer?
Can you explain inner class.
Why static functions are used?
How do you access command-line arguments within the code?
How do you replace a string in java?
Why is a constant variable important?
Can a set contain duplicates?
Can you give names of Container classes?
what is encapsulation in java? Explain
How many ways can an argument be passed to a subroutine and explain them?
What is string in java? String is a data type?
Is treeset sorted in java?
What is use of super keyword in java?