Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to make a java main menu loop after using a case

do{
  //Menu options
  System.out.print("6.) Exit
");
  System.out.print("
Enter Your Menu Choice: ");

  choice = input.nextInt();

  switch(choice){
        //Your cases from 1 to 6.
        default:
            System.out.println("Invalid menu choice; try again.");
            break;
   }
}while(choice != 6);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #main #menu #loop #case
ADD COMMENT
Topic
Name
3+8 =