Input in Java — Chapter Test

Answer all 5 questions, then submit. You need 60% to pass. Log in to save progress.

Question 1
Which package must you import to use Scanner?
Ajava.lang
Bjava.util
Cjava.io
Djava.math
Question 2
Which Scanner method reads a whole NUMBER?
Anext()
BnextInt()
CnextLine()
DcharAt()
Question 3
Which statement moves to a NEW line after printing?
ASystem.out.print()
BSystem.out.println()
CScanner.next()
D// comment
Question 4
A missing semicolon causes a…
Asyntax error
Bruntime error
Clogical error
Dno error
Question 5
A program runs but gives the WRONG answer. This is a…
Asyntax error
Bruntime error
Clogical error
Dcomment