A final class is simply a class that can’t be extended. Main use of a final class is to prohibit inheritance in Java. This does not mean that all references to objects of the class would act as if they were declared as final.
Java interview questions on final keyword
- what is final in java?
- What is final variable in java?
- What is final method in java?
- What is final class in java?
- What is blank final variable in java?
- What is static blank final variable in java?
- What is final parameter in java?
- Can we initialize blank final variable in java?
- Can we declare the main method as final?
- What is the use of final keyword in java?
- Can we change the state of an object to which a final reference variable is pointing?
- Difference between abstract method and final method in java?
- What is the use of final class in java?
- Can we change the value of an interface field?
- Can we declare constructor as final in java?