What is the super() construct of a constructor in Java?

The super keyword is similar to this keyword. Following are the scenarios where a super keyword is used.

  • It is used to differentiate the members of superclass from the members of the subclass if they have same names.
  • It is used to invoke the superclass constructor from the subclass.

Whenever you want to call the constructor of the superclass from a method or another constructor you can do so as:


class Person {
   Person(String name) {
      System.out.println("Hello "+ name);

class Student extends Person {
   Student(String name) {

   public static void main(String args[]) {
      Student st = new Student("Ram");


Hello Ram

Sharon Christine
Sharon Christine

An investment in knowledge pays the best interest

Updated on: 30-Jul-2019


Kickstart Your Career

Get certified by completing the course

Get Started