JAVA, Programmimg Languages

The ‘this’ keyword

In the body of a mehtod definition, there are times where we need to refer to the object to which the method belongs. 

To refer to the object in these cases, use the this keyword where we normally would refer to an object’s name.

The this keyword refer to the current object, and you can use it anywhere a reference to an object might appear.

this.setvisible(true);

Calls the setvisible method, and refer it to the current method.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s