PGoCareerGoCareer prep tools
Home
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

Java · Theory

Super Keyword in Java

← All stacks

Theory

38/270

Super Keyword in Java

super talks to the parent from the child. super.method() calls the parent version. super() calls a parent constructor and must be the first statement in the child constructor.

Use super when the child overrides but still wants parent behaviour too. If the parent has no no-arg constructor and you skip super(...), you get a compile error.

Putting any code before super() in a constructor is illegal. Interview line: super.method for parent method; super() for parent constructor first.

Let's take this on the board with one tiny Main class — no extra files. Super Keyword in Java — output: Parent then Child. super.show() runs Parent first; then Child prints its own line. Start from main, go line by line, and stop at each print. That output is the proof for Super Keyword.

Exam tip

super() must be the first statement in the constructor.

Example

class Parent {
  void show() { System.out.println("Parent"); }
}
class Child extends Parent {
  @Override
  void show() {
    super.show();
    System.out.println("Child");
  }
}
public class Main {
  public static void main(String[] args) {
    new Child().show();
  }
}

Super Keyword in Java — output: Parent then Child. super.show() runs Parent first; then Child prints its own line.

Short notes

  • Defsuper talks to the parent class from the child.
  • Rulesuper.method() = parent method. super() = parent constructor, first statement.
  • RememberChild can override and still call parent with super.
  • TrapCode before super() in a constructor is illegal.

Questions

1

What does super.method() do?

2

Where must super() sit in a constructor?

3

When do you need super(...)?

Previous← Covariant Return Type in JavaNextInstance Initializer Block in Java →
P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.