-3

How to do it without char c = scanner.next().charAt(0) as I didn't learn how to use 'At' and read function invokes only one character while I want it to read the entire line.

Ruchir
  • 1

1 Answers1

0

One of the approaches can be: read the line using nextLine() and store it in a String and then use charAt() something like:

String line = reader.nextLine();
char c = line.charAt(0);
MohamedSanaulla
  • 5,802
  • 5
  • 25
  • 42