I'm doing a Java assignment in Greenfoot and I'm stuck on a question about getter and setter methods which I cannot find an answer to.
I'm asked to write a getter and setter method for three attributes (name, colour, age) and then use these methods to:
(a) ensure that age cannot be less than 0 and age cannot be greater than 100
(b) ensure the only valid colours are Black, White, Brown and Grey
Any ideas or suggestions to how I would solve this problem?
Thanks in advance