Monday, February 07, 2011

Categorized list of Collection interface methods

Collection interface methods categorized:

Boolean

add(E o)

Methods to add elements to collection

Boolean

addAll(Collection<? Extends E> c)

Void

Clear()

Methods to remove elements from collection

Boolean

remove(Object o)

Boolean

removeAll(Collection<?> c)

Boolean

retainAll(Collection<?> c)

Boolean

contains(Object o)

Methods to check if specific element(s) exist in collection.

Boolean

containsAll(Collection<?> c)

Boolean

IsEmpty()

Methods to check collection at a higher level

Int

Size()

Iterator<E>

Iterator()

Methods to transform the whole collection to other representations

Object[]

ToArray()

<T> T[]

toArray(T[] a)


No comments: