![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
The getter for the magnitude
instance variable is the
magnitude
method:
Weight method definition instance magnitude ^ magnitude
There is no corresponding setter because you cannot change the value of a
Weight
instance, just as you cannot change the value of, for example,
an Integer
instance.