Java This Keyword

Java This Keyword Example explains step by step details of using java this keyword.

Java This keyword is a reference to the current object, it is very helpful when you need to refer an instance of a particular Object from its available methods or using it's constructor, also "this" keyword helps us to avoid naming conflicts.

The following are different ways to use java this keyword

  • 1) Using with instance variable
  • 2) Using with Constructor
  • 3) Pass / Return current instance