Which of the following will be true after these lines are executed?

Consider the following snippet of code:
```
Random generator = new Random();
int randNum = generator.nextInt(20) + 1;
```

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

a) randNum will hold a number between 1 and 20 inclusive.

Computer Science & Information Technology

You might also like to view...

An image can be stored as a building block

Indicate whether the statement is true or false

Computer Science & Information Technology

Which of the following devices should you use to keep machines behind it anonymous? (Select the best answer.)

A. Caching proxy B. IP proxy C. Circuit-level gateway D. Firewall E. UTM

Computer Science & Information Technology