The Collection interface provides methods such as add() and remove() that are common to all containers. Below table lists the most important methods in this interface. Take a look at them before you use them.
Methods such as add() and remove() can fail depending on the underlying container. For example, if the container is read-only, you will not be able to add or remove elements