}
driverIntensity = intensity;
driverName = name;
}
...
}
Understand that using the this keyword to chain constructor calls is never mandatory. How-
ever, when you make use of this technique, you do tend to end up with a more maintainable and
concise class definition. Again, using this technique you can simplify your programming tasks, as
the real work is delegated to a single constructor (typically the constructor that has the most param-
eters), while the other constructors simply “pass the buck.”
Do'stlaringiz bilan baham: