this refers to the current object. super refers to the parent class part of the current object.

this

Use this to access current object members.

class Student {
    String name;

    Student(String name) {
        this.name = name;
    }
}

Without this.name, the parameter can shadow the field.

Uses of this

Student() {
    this("Unknown");
}

super

Use super to access parent members or call the parent constructor.

class WebhookEvent extends DomainEvent {
    WebhookEvent() {
        super();
    }

    void publish() {
        super.publish();
        System.out.println("Webhook delivered");
    }
}

this vs super

this super
Current object Parent class part
Current class fields/methods Parent fields/methods
this() calls same-class constructor super() calls parent constructor

Interview Notes