+ 4
Hii there can I write Scanner scn = new Scanner(System. In) ;char ch=scn.nextChar();
I mean does scanner class support character input by its next method ()
6 ответов
+ 2
bro.You can't use "nextChar()".for this case use "nextLine()"
+ 1
What happens is you allocate a space(scn) for systems input and you had allocated some space(ch) in the same input space(scn) for character type(char). if it is defined in any method!
0
But it shows compile time error. @suhail
0
do import java.util.Scanner in your program
0
brother I don't think there is a method nextChar() in scanners class .use next() instead or use a array[1] for your program to store a character.
I am just a rookie
0
did you do the import? (import java.util.Scanner;)