+ 4
I can't find a method to input value of the char
(char x = s.nextChar )is not allowed ☺
4 Réponses
+ 9
Scanner scan = new Scanner (System.in);
char c = scan.next().charAt(0);
Since Scanner class doesn't have any separate method to take char input, so take the input as string using next() and consider the 1st character of it as the char input.
+ 4
many thanks💓 Shamima Yasmin
+ 3
java