Java List.add() UnsupportedOperationException

Not every List implementation supports the add() method. One common example is the List returned by Arrays.asList(): it is documented not to support any structural modification (i.e. removing or adding elements) (emphasis mine): Returns a fixed-size list backed by the specified array. Even if that’s not the specific List you’re trying to modify, the answer … Read more