I have a question about validation in Java, I have looked at previous topic and none seem to answer my little problem.
What I am trying to do is validate what is put into a string variable in the constructor but also when a set method is used.
What I need to is If Mr Miss Mrs or Ms is entered, then to set that in a Variable (title) if not then to set title as ''Not set'' and print an error, now I know how to the the last part, its the the validation of what the user is entering into the variable I am stuck in... I have tried using an array but couldn't get it to work and tried if statements, again couldn't get it to function