How can a char be entered in Java from keyboard?
You can either scan an entire line:
Scanner s = new Scanner(System.in); String str = s.nextLine();
Or you can read a single char, given you know what encoding you're dealing with:
char
char c = (char) System.in.read();
548k questions
547k answers
4 comments
86.3k users