1. What is final keyword in java?
- Final is one of the access modifier in java
- The main use of final is to make an entity to immutable. Which means that you can not change entity once it is defined.
- So you can this entity in multi-threaded programming as final entity's immutable behavior.
- We can make a class as final class, a method as final method and a variable as final variable.
- Yes, we can declare a class as final class.
- A Final class can not be inherited which means that you can not extend a final class. Or you can say that you can not create subclasses for any final class.
- The use of final class is to provide security or efficiency.
- For an instance, String is the final class.
- Yes, we can declare a method as a final method.
- A final method can not be overridden in a subclass but it can be overload in same class.
- The advantage of declaring a method as final is to prevent unexpected behavior in functionality of the crucial method.
- You can make a method as final if it has a critical functionality which should not be changed. For an instance, Object class method, notify() is an example of final method.
4. Can we create a variable as final? If Yes, What is the use of final variable?
- Yes, we can declare a variable as a final variable.
- The final variable is immutable which means once a variable is assigned, it can not be changed.
Syntax: private final int rateOfInterest = 10;
5. How can we define a final variable?
- A final variable can be defined while declaring it.
- A variable should be defined inside Constructor only if we missed to initialize it while declaring.
- If we miss to define the final variable in above cases then JVM will define a default value.
6. Can we make a reference as final?
- Yes, we can actually declare a reference as final.
- If you make a reference as final then the reference should not be reassigned to another object. But we can change object's data.
- No, we can not declare an interface as final since interface does not have definition for Interface.

8. Can we declare an abstract class as final?
- No, we can not declare an abstract class as final since we can not create an object for abstract class.
9. Can we declare a Constructor as final?
- No, we can not declare a Constructor as final since the constructor only accepts public, protected and private access modifiers.

10. What is the blank final variable?
- Nothing big deal here, the interviewer may try to confuse you or just to check how much you understood the final keyword usage.
- The answer for the above question is, a blank final variable is a final variable without initializing it while declaring the final variable.
- The blank final variable can be defined in two ways
- Through constructor, blank final variable can be defined.
- If a final variable is not be defined then JVM will be defined it with default value for that respective data type.
11. What are the differences between final method and abstract method?
Both final and abstract methods are completely opposite to each other.
- The final method must have complete implementation whereas abstract method does not have implementation.
- Once you declare a method as final then you can not override it whereas you must have to override abstract method as it does not have implementation.
- The main difference between final variable and constant variable is that constant should be known at compile time whereas final variable need not be known at compile time since final variable can be defined during run time.
- The above sentence can be put up in simple form, constant should defined during compile time and final variable need not be defined during compile time.
All the very best!!