import java.util.LinkedList;
public class LinkedListAddAllElement {
public static void main(String[] args) {
LinkedList<String> ll = new LinkedList<>();
LinkedList<String> ll1 = new LinkedList<>();
//addding element to linkedlist ll
ll.add("Ishu");
ll.add("Nishu");
ll.add("Naina");
ll.add("Nishu");
ll.add("Shiksha");
System.out.println("Before removing element, the LinkedList is :");
System.out.println(ll);
//adding elements to linkedlist ll1
ll1.add("Suhani");
ll1.add("Neha");
ll1.add("Kayna");
//will add all element common in both the linkedlist
ll.addAll(ll1);
System.out.println("After adding both lists, the Final LinkedList is :");
System.out.println(ll);
}
}