
Java Scanner Quiz
Authored by aditya bulchandani
Computers
9th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which package must be imported to use the Scanner class?
java.lang
java.util
java.io
java.scanner
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to create a Scanner object?
Scanner sc = new Scanner;
Scanner sc = new Scanner(System.in);
Scanner sc = Scanner(System.in);
Scanner(System.in) = new Scanner;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to input an integer value?
next()
nextInt()
nextInteger()
readInt()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to input a decimal (floating-point) value?
nextFloat()
nextDecimal()
nextDouble()
both a and c
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to input a single word (string without spaces)?
nextWord()
nextLine()
next()
read()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to input a complete line including spaces?
next()
nextLine()
readLine()
read()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If we type Hello World and use next(), what will be stored?
Hello
World
Hello World
Nothing
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?