taking the next character in java code example
Example 1: scanner methods java char
Scanner scanner = new Scanner(System.in);
char ch = scanner.next().charAt(0);
Example 2: java input character
import java.util.Scanner;
Scanner inp = new Scanner(System.in);
char character = inp.next().charAt(0);