What is the super keyword in Java?
Why Interviewers Ask This
Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for Java development. It reveals whether you understand the building blocks that more complex concepts rely on.
Answer
The super keyword refers to the parent (superclass) of the current class. It has three uses: accessing an overridden method from the parent class (super.methodName()), accessing a parent class field that is hidden by a subclass field (super.fieldName), and calling the parent class constructor (super(args) — must be the first statement in the subclass constructor). Every constructor implicitly calls super() if you do not explicitly call it, which chains all the way up to the Object constructor. super cannot be used in static contexts.
Common Mistake
Candidates often give textbook answers here. Interviewers are more impressed when you relate the concept to a specific problem you solved in a real Java project.