Question: Open Playlist.java, then compile and run it . Observe the output to understand what the main method is doing. Set a breakpoint on the following

Open Playlist.java, then compile and run it. Observe the output to understand what the main method is doing.
Set a breakpoint on the following line in the main method: List playlist = new ArrayList<>();
Start the debugger and wait until execution is paused at the breakpoint.
Step over this statement and then raise a viewer on the playlist object.
Step over the next several statements and watch the viewer as it shows the effect of adding songs to the playlist.
Note that four different implementing classes of the List interface are already imported (ArrayList, LinkedList, Stack, and Vector). Systematically change the instantiation of playlist to each of these classes in turn. Run and debug the program each time to observe that the functionality of the program doesnt change although the exact nature of the playlist object does indeed change.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!