+ 3
Challenge question.
Why is the answer to this java.io and not java.util? I'm pretty sure that it is wrong. Does the question mean something else? https://www.sololearn.com/post/258167/?ref=app
7 Antworten
+ 3
It's wrong, Scanner is indeed in java.util.
https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html
also in java 10
https://docs.oracle.com/javase/10/docs/api/java/util/Scanner.html
+ 2
am sure you know that io means input and output right
+ 2
✳AsterisK✳ yes I do.
+ 1
Java.io package provides classes for system input and output through data streams, serialization and the file system.... Whereas Scanner is a class in java.util package for obtaining inputs of primitive types like int, double, strings etc.....
+ 1
Obviously it's java.util package from my view
0
sarada lakshmi that is a known explanation. But you did not mention which option suits the best for that quiz question.