Methods in Collection Interface

      No Comments on Methods in Collection Interface

Collection Interface is used to represent a group of objects as a single entity. There are different methods present in Collection Interface.

Methods in Collection Interface:

1. boolean add(Object o);
2. boolean addAll(Collection c);
3. boolean contains(Object o);
4. boolean containsAll(Collection c);
5. boolean retainAll(Collection c);
6. boolean remove(Object o);
7. boolean removeAll(Object o);
8. void clear();
9. boolean isEmpty();
10. Object[] toArray();
11. int size();
12. Iterator iterator();

There is no concrete class which directly implements Collection Interface. List , Set and Queue interface extends Collection Interface.