"this" keyword can be used to represent current object or instance of any class in Java. It can also call constructor of same class and used to call overloaded constructor.
Usage of java this keyword
1. "this" keyword can be used to refer current class instance variable.
"this" keyword can be used to resolve the ambiguity between the instance variable and method/constructor parameter.
2. "this()" can be used to invoke current class constructor.
3. "this" keyword can be used to invoke current class method (implicitly).
4. "this" can be passed as an argument in the method/constructor call since it represent current object of class.
5. "this" can be used to return current class instance.
6. We can synchronize on this in synchronized block in Java
1. "this" is a final variable in Java and you cannot assign value to this.
2. If use this inside static context you will get compilation error.
3. Inside a constructor, the call to this(...) must be the first instruction.