All I am trying to do here is have the user inputted integer from the "displayMenu" method control the switch statement above in the main method. But I get the following error in this picture when I compile:
This is the error message I get when I compile
The error basically states that my actual and informal arguments differ in length.
Here is the relevant code:
public static void main(String[] args) {
int userChoice = displayMenu();
switch(userChoice) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
}
}
public static int displayMenu(int userSelection) {
Scanner keyboard = new Scanner(System.in);
userSelection = keyboard.nextInt();
return userSelection;
}
What does this error mean?