OOP · Core Java OOP Features
super Keyword
The super keyword allows a child class to access members of its parent class.
Real-World Problem
Imagine a College Management System where the Student class inherits from the Person class. Sometimes, the child class needs to access properties or methods that belong to the parent class. Why Do We Need super?
The super keyword allows a child class to access members of its parent class. It is also used to invoke the parent class constructor during object creation. What is super? The super keyword is a reference variable that refers to the immediate parent class object.

super calls the parent's constructor or reaches an overridden parent method.
class Vehicle {
String type;
Vehicle(String type) { this.type = type; }
void info() { System.out.println("Vehicle: " + type); }
}
class Bike extends Vehicle {
Bike() {
super("Two-wheeler"); // must call parent constructor first
}
void info() {
super.info(); // extend, don't fully replace, parent behavior
System.out.println("Pedal powered");
}
}