I am trying to find a way to take a char input from the keyboard.
I tried using:
Scanner reader = new Scanner(System.in);
char c = reade
The easiest way is, first change the variable to a String and accept the input as a string. Then you can control based on the input variable with an if-else or switch statement as follows.
Scanner reader = new Scanner(System.in);
String c = reader.nextLine();
switch (c) {
case "a":
break;
case "b":
break;
default:
}