+ 11

Why is the answer "java.io"?

A challenge question asked what should be imported to accept user input; Options were: java.nio java.util java.io and some other one. I chose java.util but failed it, why is the correct answer java.io(is it BufferedReader they mean and if so, that means there are two answers right?)

4th Dec 2017, 4:30 PM
David Akhihiero
David Akhihiero - avatar
2 Respuestas
+ 12
Lemme guess: (Not a java programmer though) Is it because io means input/output whereas util is utility I think io mainly deals with input/output of files, user input etc while util deals with utility objects like ArrayList, HashMap, Methods etc.. 😊😊
4th Dec 2017, 4:55 PM
Cool Codin
Cool Codin - avatar
+ 11
@Cool Codin,by java.util it means java.util.Scanner, Scanner class is for taking input, which is why I was confused, will report the question as Gordie said
4th Dec 2017, 7:39 PM
David Akhihiero
David Akhihiero - avatar