method for changing a field
I don't understand why you should make a method for changing a field.
in a tutorial i found this:
void changeCadence(int newValue)
{
cadence = newValue;
}
why should you do this? cant you just write this in your code:
cadence = newValue;
instead of using the method?
i didn't understand this from c++ either.
the tutorial sais the other objects dont have to know what this object does.
but then what exactly happens in both cases?
ps. is a function in c++ the same as a method in java? and a field a variable?

