What is this keyword?
Answer:
The this keyword in Java refers to the current object in a method or constructor.
It is to eliminate the confusion between class attributes and parameters with the same name (because a class attribute is shadowed by a method or constructor parameter).
The this keyword can be used as follows:
1. to get the current object.
2. to invoke current object's method.
3. to invoke current class constructor.
4. to return the current object from the method.
5. this can be passed as a parameter to a method call.
6. this can be passed as a parameter to a constructor.