How to use Scanner for char?

In the Scanner class, there is a int method for nextInt(), a double method for nextDouble(), a String method for nextLine(), and what is there for char?

Author: Anton Sorokin, 2019-03-17

1 answers

You can take the symbol{[2] from the next method]}

Scanner scanner = new Scanner(System.in);
char c = scanner.next().charAt(0);
 1
Author: Komdosh, 2019-03-17 05:37:34