Skip to content
Sharp

Core Java · interview question

Which Java package provides the Scanner class for reading input from the console?

Multiple choiceEasychapter-1-curatedpremiumcore-javaconsole-input-and-output
Choose one answer
Answer and explanation

Correct answer

B. Java.util

Why

The 'Scanner' class is part of the 'java.util' package, which provides utility classes for common operations, including input processing.

Test yourself on Core Java

A free test with instant, explained results. No account needed.

Start free test
All Core Java questions →