The super keyword is used to access members of an immediate parent class, such as its variables, methods, or constructors. Since every Java class implicitly extends Object if no other superclass is specified, a class technically always has a superclass. However, using super to access members that do not exist in the parent class will result in a compilation error.
If a parent class contains a method, the child class can access it using super.
class Parent {
void display() {
System.out.println("Parent Method");
}
}
class Child extends Parent {
void show() {
super.display();
}
}
public class Demo {
public static void main(String[] args) {
Child child = new Child();
child.show();
}
}Parent Method
class Employee {
void display() {
super.display(); // Compilation Error
}
}cannot find symbol
In this case, Employee directly extends Object, and Object does not contain a display() method. Therefore, the compiler cannot resolve the call.
class Employee {
}class Employee extends Object {
}Therefore, a class always has Object as its ultimate superclass.
super.name;
super.display();
super();
A concise interview answer is
The super keyword is used to access members of the immediate parent class. Since every Java class implicitly extends Object, a class always has a superclass. However, using super to access a parent member that does not exist results in a compilation error.
Last updated: 1 November 2026
Previous question: Can 'this' keyword be assigned a new value in Java?
Next question: Can the this or super keyword be used in a static method?