Answer to Question #273051 in Java | JSP | JSF for Jacob

Question #273051
  1. Using this Online IDE, create three (3) linked lists named songs, artists, and playlist. You may refer to the sample codes in this module. 
  2. Add five (5) song titles to the first linked list then add the five (5) singers/bands of those songs to the second linked list.
  3. Combine the first two (2) linked lists and add each combination to the third linked list, which is playlist.
  4. Display the content of the three (3) linked lists in separate lines. See sample output below.
1
Expert's answer
2021-11-29T18:44:39-0500
import java.util.*;
public class Main {
 public static void main(String[] args) {
  LinkedList <String> print = new LinkedList <String> ();
  
          print.add("Together");
          print.add("Million Reasons");
          print.add("The Climb");
          print.add("Who You Are");
          print.add("A Woman's Worth");
          System.out.println("songs: " + print);
         LinkedList <String> display = new LinkedList <String> ();
          display.add("Mariah Carey");
          display.add("Lady Gaga");
          display.add("Miley Cyrus");
          display.add("Jessie J");
          display.add("Alicia Keys");
          System.out.println("Artists:" + display);
        LinkedList <String> m = new LinkedList <String> ();
        m.addAll(print);
        m.addAll(display);
        System.out.println("playlist:" + m);
             }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS