The Collection interface specifies the contract that all collections should implement. Some of the operations in the interface are optional, meaning that a collection may choose to provide a stub implementation of such an operation that throws an UnsupportedOperationException when invoked. The implementations of collections from the java.util package support all the optional operations in the Collection interface (see Figure 11.2 and Table 11.2).
Many of the methods return a boolean value to indicate whether the collection was modified as a result of the operation.
The basic operations are used to query a collection about its contents and allow elements to be added and removed from a collection.
int size() ...