Hello everyone, I'm attempting to create a simple choose your own adventure game using nested switch statements. The problem is that whenever I reach "the end" (death, etc.) the switch statements fall through, despite having "break;". This is an extremely simplified version of my code, just to show the issue. Press 1. to start the game, then 2. This will cause it to fall through to the alternate menu options.
import java.util.Scanner; class ProblemExample { public static void main(String[] args) { Scanner scan = new Scanner (System.in); System.out.println("Welcome to The Game,"); System.out.println("by **********"); System.out.println("1. Begin game"); System.out.println("2. Help"); System.out.println("3. Quit"); int inputStartMenu = scan.nextInt(); switch (inputStartMenu) {case 1: System.out.println("case 1 of switch(inputstartmenu)"); int inputA = scan.nextInt(); switch (inputA) {case 1: System.out.println("case 1 of switch(inputA)"); break; case 2: System.out.println("case 2 of switch(inputA)"); break;}[B][U] break;[/U][/B] case 2: System.out.println("Instructions/Summary"); break; case 3: System.out.println("Goodbye"); break;} } }