Question: Exercise 4 . 4 3 Challenge exercise This and the following exercises present a challenge because they involve using some things that we have not
Exercise Challenge exercise This and the following exercises present a challenge because they involve using some things that we have not covered explicitly. Nevertheless, you should be able to make a reasonable attempt at them if you have a comfortable grasp of the material covered so far. They involve adding something that most music players have: a "shuffle," or "randomplay," feature.
The ava. ut i package contains the Random class whose next Int method will generate a positive random integer within a limited range. Write a method in the Musicorganizer class to select a single random track from its list and play it
Hint: You will need to import Random and create a Random object, either directly in the new method, or in the constructor and stored in a field. You will need to find the API documentation for the Random class and check its methods to choose the correct version of nextInt. Alternatively, we cover the Random class in Chapter
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
