+ 2
is there a way to ask for user's input without the Scanner-class?
I just wrote this code: https://code.sololearn.com/c581fS0jY93a/#java It works locally on my machine but on the playground it doesn't. It throws the error that scanner doesn't exist. I guess importing the Scanner-class from the utils library is not possible here. What are options to ask the user for their input?
1 Resposta
+ 2
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String s = input.readLine();