In Java, the super keyword is used to refer to the immediate parent class of a subclass. It is primarily used in two ways:
- To call the constructor of the parent class from the constructor of the subclass, ensuring that the initialization of the parent class is performed.
- To access member variables or methods of the parent class when they are overridden or hidden by the subclass.