Question: The actual List interface in the java.util package has several methods beyond the ones implemented in this chapter. Write a version of LinkedList that adds
The actual List interface in the java.util package has several methods beyond the ones implemented in this chapter. Write a version of LinkedList that adds some or all of these methods. The methods to add are the following (some headers are slightly modified; see the Java API Specification for descriptions of each method):
- public void addAll(int index, List list)
- public boolean containsAll(List list)
- public boolean equals(Object o)
- public int lastIndexOf(Object o)
- public boolean remove(Object o)
- public void removeAll(List list)
- public void retainAll(List list)
- public Object[] toArray()
Step by Step Solution
3.34 Rating (148 Votes )
There are 3 Steps involved in it
import javautil public class LinkedList1 public static void mainString args LinkedList llnew LinkedList SystemoutprintlnInitial list of elements ll ll... View full answer
Get step-by-step solutions from verified subject matter experts
