In this first problem, you will declare the instance variable named 'set' of type ArrayList<E>. YOU MUST use the name set for this...
X1362: ArraySet - Constructor
In this first problem, you will declare the instance
variable named 'set' of type ArrayList<E>. YOU MUST
use the name set for this instance variable. In the
constructor, instantiate the set by creating a new
ArrayList<E>. The clear() method should just
(re)create a new set as a way to initialize it.
You can assume the class definition is there for you:
import itsc2214.*;
public class ArraySet<E> implements SetADT<E> {
// code for the problems goes here
}
You might want to look at the documentation for
ArrayList
to refresh your memory of how to use that class.
Your Answer:
Feedback
Your feedback will appear here when you check your answer.