Assign to variable: keyword new, followed by class name, followed by ().
Determine whether parameter(s) are appropriate (API)
Number of parameters
Data types of the parameters
Subsection4.4.1
ExercisesExercises
1.
Q5: Click on the variables (object references) in the following code
/* creates new random object with default seed */Randomrand = new Random();/* creates new random object with seed parameter */Randomrand2 = new Random(1234567890);
2.
Q6: Click on the class names (but not constructors) in the following code
/* creates new random object with default seed */Randomrand = new Random();/* creates new random object with seed parameter */Randomrand2 = new Random(1234567890);
3.
Q7: Click on the calls to the Random constructor in the following code
/* creates new random object with default seed */Randomrand = new Random();/* creates new random object with seed parameter */Randomrand2 = new Random(1234567890);
4.
Q8: Click on the parameters which are passed to the Random constructor in the following code
/* creates new random object with default seed */Randomrand = new Random();/* creates new random object with seed parameter */Randomrand2 = new Random(1234567890);