+ 1

What is the use of "this" keyword

27th Jan 2017, 7:03 AM
Sambit sinha
2 Respuestas
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.
27th Jan 2017, 7:07 AM
Blightedsage
Blightedsage - avatar
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
29th Jan 2017, 6:36 AM
Pavan Kumar T S
Pavan Kumar T S - avatar