Grokking Java Intermediate
Vote

0% completed

​

The 'this' Keyword

What is the this Keyword?

The this keyword in Java is a reference to the current object, the instance on which a method or constructor is being invoked. It plays a crucial role in differentiating between class members and parameters, especially when they share the same name.

  • Characteristics:
    • Used to refer to the current object's members (variables and methods).
    • Helps in distinguishing between class members and parameters with the same name.
    • Can be used to invoke other constructors within the same class.

Syntax of the this Keyword

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content