While studying the Collection API, we find that some methods (add, remove,…) may throw a java.lang.UnsupportedOperationException if the current implementation of the Collection does not support those functionalities.
Is there,actually, in the JDK, a concrete Collection that does not support those methods ?
Thanks a lot for your answers.
The obvious examples are the implementations returned from, say,
Collections.unmodifiableCollection()and other similar methods. Methods that would change theCollectionthrow this exception.