menuSelection is a private String member variable. showMenu () spits out a menu to the console.
When I run the program, I get this: Main Menu: (enter in either upper or lower case) AP = Add person EP = Edit person DP = Delete person AT = Add telephone number ET = Edit telephone number DT = Delete telephone number Q = Quit Enter your choice: AP input...AP... no match
So, it appears that the result of stdin.readLine() is being assigned to the variable menuSelection, since I can print it out. However, I can't figure out why the result of is failing when I clearly typed AP into the console.
Be careful - this gets alot of folks. You're really asking if the memory address of menuSelection is the same as the memory address that the compiler assigned to your string. You'll want to do something like:
to check if the strings contain the same value.
<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Joined: May 12, 2003
Duh - a String is an object, not a primitive. (slap on forehead) Thank you Scott.