Question: The actual List interface in the java.util package has several methods beyond the ones implemented in this chapter. Write a version of ArrayList 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 ArrayList that adds some or all of these methods. The methods to add are as follows (some headers are slightly modified; see the Java API Specification for descriptions of each method):

  • public void addAll(int index, ArrayList list)
  • public boolean containsAll(ArrayList list)
  • public boolean equals(Object o)
  • public int lastIndexOf(Object o)
  • public boolean remove(Object o)
  • public void removeAll(ArrayList list)
  • public void retainAll(ArrayList list)
  • public Object[] toArray()

Step by Step Solution

3.43 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautilArrayList public class Main public static void mainString args ArrayList letters new ... View full answer

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

Document Format (2 attachments)

PDF file Icon

2079_60f58f34f29c6_857009.pdf

180 KBs PDF File

Word file Icon

2079_60f58f34f29c6_857009.docx

120 KBs Word File

Students Have Also Explored These Related Building Java Programs A Back to Basics Approach Questions!