Multiple Choice
Consider the following snippet of code: Random generator = new Random() ;
Int randNum = generator.nextInt(20) + 1;
Which of the following will be true after these lines are executed?
A) randNum will hold a number between 1 and 20 inclusive.
B) randNum will hold a number between 0 and 20 inclusive.
C) randNum will hold a number between 1 and 21 inclusive.
D) these lines will not be executed because a compiler error will result.
E) none of the above
Correct Answer:

Verified
Correct Answer:
Verified
Q22: Suppose a Random object has been created
Q23: Which of the following represents the proper
Q24: Which of the following best describes what
Q25: Multiple reference variables can refer to the
Q26: Suppose we have a String object referenced
Q28: When there are no references to an
Q29: _ is the automatic conversion between a
Q30: What is output by the following code
Q31: Write a declaration for an enumerated type
Q32: When called with integer parameter n, the