Log in
Sign up for FREE
arrow_back
Library
Input Test
By Mickey Arnold
star
star
star
star
star
Share
share
Last updated almost 2 years ago
25 questions
Add this activity
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
Question 1
1.
Which of the following Scanner methods can be used to read in 65535 ?
a. nextShort()
b. nextInt()
c. nextByte()
Question 2
2.
Which of the following Scanner methods can be used to read in a line of words?
nextInt()
nextShort()
nextLine()
Question 3
3.
Which of the following Scanner methods can be used to read in the value “apluscompsciisthebest” ?
a. next()
b. nextDouble()
c. nextByte()
Question 4
4.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextFloat();
float
byte
Question 5
5.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextLine();
float
byte
Question 6
6.
Which of the following Scanner methods can be used to read in a double?
a. nextInt()
b. nextDouble()
c. nextDble()
Question 7
7.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextLong();
short
byte
Question 8
8.
Which of the following Scanner methods can be used to read in a short?
nextByte()
nextShort()
nextshort()
Question 9
9.
Which of the following is the Java class used for input?
a. Keyboard
b. Scanner
c. Reader
Question 10
10.
Which of the following is used in the Scanner constructor to connect to the keyboard?
a. System.out
b. System.in
c. Keyboard.in
Question 11
11.
Which of the following Scanner methods can be used to read in a String?
a. nextInt()
b. nextDouble()
c. next()
Question 12
12.
Which of the following Scanner methods can be used to read in an integer?
a. nextInt()
b. nextDouble()
c. nextInteger()
Question 13
13.
Which of the following Scanner methods can be used to read in a byte?
nextInteger()
nextBite()
nextBite()
Question 14
14.
Which of the following Scanner methods can be used to read in the value
”apluscompsci is the best” ?
a. next()
b. nextLine()
Question 15
15.
Which of the following would correctly define and instantiate a Scanner?
Scanner kb = Scanner(System.in);
Scanner kb = new Scanner(System.in);
Question 16
16.
Which of the following Scanner methods can be used to read in a long?
nextInt()
nextShort()
nextLine()
Question 17
17.
Given the following statement, var must be defined as which of the following types?
var=keyboard.next();
float
byte
Question 18
18.
Which of the following Scanner methods can be used to read in 511.278 ?
a. nextDouble()
b. nextLong()
c. nextByte()
Question 19
19.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextByte();
bytes
byte
Question 20
20.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextDouble();
short
double
Question 21
21.
Which of the following Scanner methods can be used to read in 45 ?
a. nextByte()
b. nextShort()
c. nextInt()
Question 22
22.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextShort();
short
double
Question 23
23.
Which of the following Scanner methods can be used to read in 32760 ?
a. nextShort()
b. nextInt()
c. nextByte()
Question 24
24.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextInt();
short
byte
Question 25
25.
Which of the following Scanner methods can be used to read in a float?
nextInt()
nextLong()
nextfloat()
d. A and B only
e. A, B, and C
nextFloat()
nextLong()
d. nextInt()
e. A and B only
char
boolean
String
char
boolean
String
d. A and B only
e. A, B, and C
int
long
String
nextShorts()
nextChar()
d. GetStuff
e. A and B only
d. Keyboard.out
e. A and B only
d. nextFloat()
e. nextByte()
d. A and B only
e. A, B, and C
nextBite()
nextByte()
c. nextByte()
d. nextInt()
e. A and B only
Scanner new kb = Scanner(System.in);
Scanner kb = new kb(System.in);
none of these
nextFloat()
nextLong()
char
boolean
String
d. nextInt()
e. A and B only
bite
boolean
String
int
long
String
d. nextDouble()
e. all of these
byte
char
String
d. A and B only
e. A, B, and C
int
char
String
nextFloat()
e. nextByte()