Advanced Placement Computer Science
ArrayListSet
due: Wednesday, November 19th [5pm]
assignment:
Write a class that implements the Set interface using an ArrayList object. Design an applet to test your new class.
methods to override
- int size()
- boolean contains(Object o)
- boolean add(E e)
- if e is not present in this set, adds e and returns true; otherwise returns false
- boolean remove(Object o)
- if o is present in this set, removes o and returns true; otherwise returns false
- Iterator<E> iterator()
- void clear()
Select three other methods from the Set API to override.
Generated by NetBeans IDE