char as input in java code example
Example 1: nextchar in java
Scanner scanner = new Scanner(System.in);
char ch = scanner.next().charAt(0);
Example 2: input char java
char c = reader.next().charAt(0);
Scanner scanner = new Scanner(System.in);
char ch = scanner.next().charAt(0);
char c = reader.next().charAt(0);