Tuesday 19 January 2016

This keyword in java

This keyword in Java

This keyword in java is the reference variable that refer current object. In java we use two types of this keyword, first is this . (this dot) and this() (this off).

This keyword in java


This . is used for make difference between base class variable and derived class variable.
This() is used for call one constructor within another constructor.

Syntax of this .

this.data member of current class;

Syntax for this()

this() 

No comments:

Post a Comment