anonymous
  • anonymous
how do I make this menu list work in java? System.out.println("Please Enter the choose option: "); optionChoose = input.nextInt(); switch (optionChoose) { case '1' : break; case '2' : break; case '3' : break; case '4' : break; default: System.out.println("Invaild Selection"); } }while(optionChoose != '4');
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
case '1': those are where I'm going to do the other methods. I want the program to exist when the user enter 4 which is case 4 to exist. But it doesn't work for some reason.
anonymous
  • anonymous
I am not an expert of Java but I noticed that you use nextInt() method but in the switch block you check against characters -- this may be a problem.
anonymous
  • anonymous
gentoolx could be right. try to leave out the apostrophs ' ... case 4 : break; ... because you check against characters and not int-values your exit-case can never become true.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
Thank you guys so much. You guys are life savers. You guys are right about apostrophs. If I put the apostrophs, it would make it be an integer. Thank you so much again

Looking for something else?

Not the answer you are looking for? Search for more explanations.