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()
d. A and B only
e. A, B, and C
Question 2
2.
Which of the following Scanner methods can be used to read in a line of words?
nextInt()
nextShort()
nextLine()
nextFloat()
nextLong()
Question 3
3.
Which of the following Scanner methods can be used to read in the value “apluscompsciisthebest” ?
a. next()
b. nextDouble()
c. nextByte()
d. nextInt()
e. A and B only
Question 4
4.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextFloat();
float
byte
char
boolean
String
Question 5
5.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextLine();
float
byte
char
boolean
String
Question 6
6.
Which of the following Scanner methods can be used to read in a double?
a. nextInt()
b. nextDouble()
c. nextDble()
d. A and B only
e. A, B, and C
Question 7
7.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextLong();
short
byte
int
long
String
Question 8
8.
Which of the following Scanner methods can be used to read in a short?
nextByte()
nextShort()
nextshort()
nextShorts()
nextChar()
Question 9
9.
Which of the following is the Java class used for input?
a. Keyboard
b. Scanner
c. Reader
d. GetStuff
e. A and B only
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
d. Keyboard.out
e. A and B only
Question 11
11.
Which of the following Scanner methods can be used to read in a String?
a. nextInt()
b. nextDouble()
c. next()
d. nextFloat()
e. nextByte()
Question 12
12.
Which of the following Scanner methods can be used to read in an integer?
a. nextInt()
b. nextDouble()
c. nextInteger()
d. A and B only
e. A, B, and C
Question 13
13.
Which of the following Scanner methods can be used to read in a byte?
nextInteger()
nextBite()
nextBite()
nextBite()
nextByte()
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()
c. nextByte()
d. nextInt()
e. A and B only
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);
Scanner new kb = Scanner(System.in);
Scanner kb = new kb(System.in);
none of these
Question 16
16.
Which of the following Scanner methods can be used to read in a long?
nextInt()
nextShort()
nextLine()
nextFloat()
nextLong()
Question 17
17.
Given the following statement, var must be defined as which of the following types?
var=keyboard.next();
float
byte
char
boolean
String
Question 18
18.
Which of the following Scanner methods can be used to read in 511.278 ?
a. nextDouble()
b. nextLong()
c. nextByte()
d. nextInt()
e. A and B only
Question 19
19.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextByte();
bytes
byte
bite
boolean
String
Question 20
20.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextDouble();
short
double
int
long
String
Question 21
21.
Which of the following Scanner methods can be used to read in 45 ?
a. nextByte()
b. nextShort()
c. nextInt()
d. nextDouble()
e. all of these
Question 22
22.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextShort();
short
double
byte
char
String
Question 23
23.
Which of the following Scanner methods can be used to read in 32760 ?
a. nextShort()
b. nextInt()
c. nextByte()
d. A and B only
e. A, B, and C
Question 24
24.
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextInt();
short
byte
int
char
String
Question 25
25.
Which of the following Scanner methods can be used to read in a float?
nextInt()
nextLong()
nextfloat()
nextFloat()
e. nextByte()