0

Use of this

why is it not referencing the 'legs' variable using 'this.legs'?

12th Dec 2016, 10:19 PM
Matteo Furlan
Matteo Furlan - avatar
4 Antworten
+ 1
generally you use the term this to remove ambiguity, for example when your parameter has the same name than the member variable
20th Dec 2016, 8:49 AM
Nofel Tiani
Nofel Tiani - avatar
0
so basically it's not mandatory
29th Dec 2016, 12:37 PM
Matteo Furlan
Matteo Furlan - avatar
0
ofcourse it is not..anyone use it just to represent the current object
13th Feb 2017, 12:23 PM
ibrahim selman
0
that's correct, it is not mandatory but in some situations you will have to use it to point to the correct variable
12th Apr 2017, 8:38 PM
Nofel Tiani
Nofel Tiani - avatar