Super keyword in java
● The super keyword in java is a reference variable which is used to refer immediate parent class object.
● Whenever you create the instance of subclass, an instance of parent class is created implicitly which is referred by super reference variable.
Usage of java super Keyword :-
● super can be used to refer immediate parent class instance variable.
● super can be used to invoke immediate parent class method.
● super() can be used to invoke immediate parent class constructor.

1) Super is used to refer immediate parent class instance variable.
● We can use super keyword to access the data member or field of parent class.
● It is used if parent class and child class have same fields.
2) Super can be used to invoke parent class method
● The super keyword can also be used to invoke parent class method.
● It should be used if subclass contains the same method as parent class.
● In other words, it is used if method is overridden.
● To call the parent class method, we need to use super keyword.
3) Super is used to invoke parent class constructor.
● The super keyword can also be used to invoke the parent class constructor.
Super() in constructor
super() is added in each class constructor automatically by compiler if there is no super() or this(). But, it also adds super() as the first statement.
Final keyword in java

● The final keyword in java is used to restrict the user.
● The java final keyword can be used in many context.
● Final can be:
– Variable
– Method
– class
● The final keyword can be applied with the variables, a final variable that have no value it is called blank final variable or uninitialized final variable.
● It can be initialized in the constructor only.
● The blank final variable can be static also which will be initialized in the static block only.
● Final Variable
– If you make any variable as final, you cannot change the value of final variable(It will be constant).
● Final method
– If you make any method as final, you cannot override it.
● Final class
– If you make any class as final, you cannot extend it.
● Can we declare a constructor final? – No, because constructor is never inherited.
Abstract keyword in java
● A class that is declared with abstract keyword, is known as abstract class in java.
● It can have abstract and non-abstract methods (method with body).
● Abstraction is a process of hiding the implementation details and showing only functionality to the user.
● There are two ways to achieve abstraction in java:-
– Abstract class
– Interface
● Abstract class
● A class that is declared as abstract is known as abstract class.
● It needs to be extended and its method implemented.
● It cannot be instantiated.
● Example :-
abstract class A{}
● Abstract method
● A method that is declared as abstract and does not have implementation is known as abstract method.
● Example :-
abstract void printStatus();//no body and abstract
Some rules of Abstract Keyword
● If there is any abstract method in a class, that class must be abstract.
● If you are extending any abstract class that have abstract method, you must either provide the implementation of the method or make this class abstract.

Different Between Abstract Class V/s Interface

NeXt Artical Related Exception Handling in Java

Don't Forget to Share your Opinion About This post in Comment Section, Your One Comment Will Not only Make Our day But will Make our Year. And Do mention Of you have any ideas for our Blog:)
Other Java Related Topic:-
0 Comments