# this Java Keyword

The this keyword refers to the current instance.

## Examples

      public class MyClass
      {
         int number;

         public MyClass(int number)
         {
            this.number = number;
         }
      }

## Remarks

- The this keyword is used to refer to the current instance when a reference may be ambiguous.

- In the example above, the constructor argument number has the same name as a member variable of the class. this.number means specifically the number member variable of this instance of MyClass.

Related Topics

None.