Log in
Sign up for FREE
arrow_back
Library

Input Test

star
star
star
star
star
Last updated about 2 years ago
25 questions
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.

Question 2
2.

Question 3
3.

Question 4
4.

Question 5
5.

Question 6
6.

Question 7
7.

Question 8
8.

Question 9
9.

Question 10
10.

Question 11
11.

Question 12
12.

Question 13
13.

Question 14
14.

Question 15
15.

Question 16
16.

Question 17
17.

Question 18
18.

Question 19
19.

Question 20
20.

Question 21
21.

Question 22
22.

Question 23
23.

Question 24
24.

Question 25
25.

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
Which of the following Scanner methods can be used to read in a line of words?
nextInt()
nextShort()
nextLine()
nextFloat()
nextLong()
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
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextFloat();
float
byte
char
boolean
String
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextLine();
float
byte
char
boolean
String
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
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextLong();
short
byte
int
long
String
Which of the following Scanner methods can be used to read in a short?
nextByte()
nextShort()
nextshort()
nextShorts()
nextChar()
Which of the following is the Java class used for input?
a. Keyboard
b. Scanner
c. Reader
d. GetStuff
e. A and B only
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
Which of the following Scanner methods can be used to read in a String?
a. nextInt()
b. nextDouble()
c. next()
d. nextFloat()
e. nextByte()
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
Which of the following Scanner methods can be used to read in a byte?
nextInteger()
nextBite()
nextBite()
nextBite()
nextByte()
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
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
Which of the following Scanner methods can be used to read in a long?
nextInt()
nextShort()
nextLine()
nextFloat()
nextLong()
Given the following statement, var must be defined as which of the following types?
var=keyboard.next();
float
byte
char
boolean
String
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
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextByte();
bytes
byte
bite
boolean
String
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextDouble();
short
double
int
long
String
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
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextShort();
short
double
byte
char
String
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
Given the following statement, var must be defined as which of the following types?
var=keyboard.nextInt();
short
byte
int
char
String
Which of the following Scanner methods can be used to read in a float?
nextInt()
nextLong()
nextfloat()
nextFloat()
e. nextByte()