This definition:
Java’s ‘this’ keyword is used to refer the current instance of the method on which it is used.Following are the ways to use this
1) To specifically denote that the instance variable is used instead of static or local varible.That is,
private String javaFAQ;
void methodName(String javaFAQ) {
this.javaFAQ = javaFAQ;
}
Here this refers to the instance variable. Here the precedence is high for the local variable. Therefore the absense of the this denotes the local variable. If the local variable that is parameter’s name is not same as instance variable then irrespective of this is used or not it denotes the instance variable.
2) This is used to refer the constructors
public JavaQuestions(String javapapers) {
this(javapapers, true);
}
This invokes the constructor of the same java class which has two parameters.