this is a reference to the current object.

It is used when we want to access the current object's fields, methods, or constructors.

1. Access Current Object's Fields

Most commonly, this is used when a parameter and a field have the same name.

class Student {
    String name;
    int age;

    Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
}

Here:

this.name → object's field
name      → constructor parameter

So:

this.name = name;

means assign the parameter name to the current object's name field.


2. Call Current Object's Method

class Student {

    void study() {
        System.out.println("Studying");
    }

    void start() {
        this.study();
    }
}

this.study() means:

Call study() on the current object.

this can often be omitted here:

study();

3. Pass the Current Object

this can be passed as an argument to another method or constructor.