This week's giveaways are in the MongoDB and Jobs Discussion forums. We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line! See this thread and this one for details.
After creating the scanner console and such, this is my code. I want the user to enter one of two options or it will generate an error message. However, I ALWAYS get the error message, no matter what I enter.
Enter the student's status (type either resident or nonresident)
Invalid status. Entry must be either resident or nonresident. Enter again
I'm sure this is some dumb error (of course), but I don't know what it is. What am I missing?
Joined: Oct 13, 2005
That is what comes from using == and != to test reference types for equality. Try theequalsmethod.
Joined: Oct 20, 2010
Ah! I figured out what you mean. Took a little bit to determine how to use equals() to verify INequality, but it worked.
Thank you for the quick and helpful answer!!