0
What is this?
Not use this keyword but still refer to its object, why? https://code.sololearn.com/cnjfnHoNfNvT/?ref=app
1 Answer
+ 1
Using 'this' is optional. It is still used, so it can "unhide" the properties like this:
class Animal {
String name;
Animal(String name) {
// Using "name" would just result in the argument given
this.name = name;
}