this keyword in java | Java Training Videos

This Java Training Videos “this keyword in java” post explains clearly about pre defined non static variable ‘this’ in java application, and how to use ‘this’ keyword in java and accessing class members using ‘this’.


 

this:

  • It is a keyword.
  • It is a pre-defined non static variable.
  • It holds Object address.
  • It must be used only inside ‘non-static context’.

 

Why We cannot use ‘this’ inside static context?

 

Printing Address of class using ‘this :

 

Share this