Professional Documents
Culture Documents
It is commonly used
to differentiate between instance variables and method parameters with the same name, and to
access instance members within an instance method.
class Student
{
// Instance variables
private String name;
private int age;
// Constructor
public Student(String name, int age)
{
// Use 'this' keyword to refer to instance variables
this.name = name;
this.age = age;
}