![]() |
![]() |
![]() |
![]() |
![]() |
|
In general, instance-creation methods, setters, and getters have the power
to isolate you from the details of how a class is implemented. Once you
have written those methods, you can forget about how they set and get
values; none of the details, such as whether you have a fCalories or
a fGrams instance variable, clutter programs that use Food
instances.