Question: Exercise 6 . 6 8 Change the method bounce in class BallDemo to let the user choose how many balls should be bouncing. For this
Exercise
Change the method bounce in class BallDemo to let the user choose how many balls should be bouncing.
For this exercise, you should use a collection to store the balls. This way, the method can deal with or ballsany number you want. The balls should initially be placed in a row along the top of the canvas.
Which type of collection should you choose? So far, we have seen an ArrayList, a HashMap and a HashSet. Try the next two exercises first, before you write your implementation.
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
