reset password
Author Message
nikitacampos
Posts: 3
Posted 13:20 Jan 29, 2016 |

For the drink class, is there supposed to be getters and setters for the data fields like in the order class? Can I add my own? 

Jennings.Benji
Posts: 7
Posted 09:07 Feb 01, 2016 |

I am pretty sure that we don't have to use gets/sets because we only have to read the field information when we are printing strings. These methods are a part of the class and, therefore, can access private variables without gets/sets.

Maybe we will add them if we incorporate a way to edit existing drinks on the order? Although, since the types of drinks (coffee, tea, etc) are different sub classes of the parent class, 'Drink', I would imagine that the easiest way to edit a drink would be to run the constructor again and replace the old drink all together.  Garbage collection should take care of the old and unused object right?