I'm just trying to create a simple switch statement structure:
SwitchStatement.java:
public class SwitchStatement { public void displayMenu() { System.out.println("Select a bloodtype:\n Option 1: AB-negative\n Option 2: B-negative\n Option 3: AB-positive\n" + " Option 4: A-negative\n Option 5: O-negative\n Option 6: B-positive\n Option 7: A-positive\n Option 8: O-positive"); } public String Menu() { Scanner menuSelect = new Scanner(System.in); String bloodtype; switch(menuSelect.NextInt()) { case 1: bloodtype = "AB-negative"; System.out.println("You selected the " + bloodtype + " bloodtype."); break; case 2: bloodtype = "B-negative"; System.out.println("You selected the " + bloodtype + " bloodtype."); break; case 3: bloodtype = "AB-positive"; System.out.println("You selected the " + bloodtype + " bloodtype."); break; case 4: bloodtype = "A-negative"; System.out.println("You selected the " + bloodtype + " bloodtype."); break; case 5: bloodtype = "O-negative"; System.out.println("You selected the " + bloodtype + " bloodtype."); break; case 6: bloodtype = "B-positive"; System.out.println("You selected the " + bloodtype + " bloodtype."); break; case 7: bloodtype = "A-positive"; System.out.println("You selected the " + bloodtype + " bloodtype."); break; case 8: bloodtype = "O-positive"; System.out.println("You selected the " + bloodtype + " bloodtype."); break; default: System.err.println("Invalid option. Choose an option between 1 and 8."); break; } return bloodtype; } }
Main.java:
[CODE]
Line 15 error: "The method NextInt() is undefined for the type Scanner"
What am I missing?