6 uses of 'this' keyword

0

6 uses of 'this' keyword:

1. Stroring current object reference.
2. Accessing non-static variables and methods.
3. Accessing other constructor of same class without creating new object.
4. Differentiating non-static variables memory from one object to other object of some class in constructor, non-static block and non-static method.
5. Differentiating non-static variables from a parameter or from a local variable if both have same name.
6. Sending current object as argument and return type to other methods of same or another class.

About the author

Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus. Aenean fermentum, eget tincidunt.

0 comments:

Recent Posts