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

    1 answer 1

    You can take the symbol from the next method

     Scanner scanner = new Scanner(System.in); char c = scanner.next().charAt(0); 
    • why .next (). charAt (0); It turns out will read up to a space and only 0 index? - user328753