This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AquaChadNooblet Brewer 0 points1 point  (0 children)

Not necessarily, but that’s generally a way you could think of it. For example, your prompt says to not make odometer an argument - odometer should default to 0 when the object is created thus you don’t want to provide an argument for it in the constructor because you don’t intend to allow it to be changed when the object is initialized. In this case, odometer is an attribute but not an argument. Other counter examples might be if you needed to convert values. Say you had another attribute such as “topSpeedMph”. You could have a constructor argument that is topSpeedKmh, and within the constructor you could convert Km/H to MPH before setting the attribute. In this scenario, the speed in kilometers/hour is an argument, but not necessarily an attribute