Jdk1.5 has enums right? I see enums as a way of reducing developer errors. Is that the main purpose of enums? Can someone give a simple example that explains the use of enums and what problems would we have faced without them.
you will have possibility of mistakenly putting 'SHE-MALE' on it (not that there is no such this in reality), but your system is expecting only 'MALE' or 'FEMALE'. Add also the fact that in comparing string, you must trim() and compare ignoring case.