Skip to content

Instantly share code, notes, and snippets.

@clandry94
Created March 17, 2015 01:03
Show Gist options
  • Save clandry94/2ead2c317e5e4e4fccae to your computer and use it in GitHub Desktop.
Save clandry94/2ead2c317e5e4e4fccae to your computer and use it in GitHub Desktop.
while(isRunning)
{
int val = input.nextInt(); //menu item select
if(val == 1) {
val = input.nextInt(); //Get input
if(val > 2)
{
System.out.println("Bad input!")
continue;
}
//Do other stuff here
}
if(val == 2) {
val = input.nextInt(); //Get input
if(val < 1 || val > 3)
{
System.out.println("Bad input!")
continue;
}
//Do other stuff here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment