+ 1
What is the use of "this" keyword
2 Respostas
0
'this' refers to the object itself, so you can call its own methods versus say, its parent class's if a method is overidden.
0
this refers object for example in constructors
int a;
int b;
public Animal(int a,int b)
{
this.a=a;
this.b=b;
}
this.a refers to instace variable a in this case