Multiple Choice
Assume that we have a Random object referenced by a variable called generator. Which of the following lines will generate a random number in the range 5-20 and store it in the int variable randNum?
A) randNum = generator.nextInt(15) + 5;
B) randNum = generator.nextInt(15) + 6;
C) randNum = generator.nextInt(16) + 5;
D) randNum = generator.nextInt(16) + 6;
E) none of the above
Correct Answer:

Verified
Correct Answer:
Verified
Q5: The _ operator is used to instantiate
Q6: Which of the following is an invalid
Q7: Write a single line that creates a
Q8: Suppose we have a String object called
Q9: Which of the following is a correct
Q11: Write an expression that will compute the
Q12: The Math class is part of the
Q13: Explain how variables representing objects and variables
Q14: Write a short program that allows the
Q15: All of the classes contained in the