Exception in thread “main“ java.lang.UnsupportedOperationException error handling

The List collection uses the add and remove methods to report UnsupportedOperationException.
insert image description here
Original code:
insert image description here

Cause of Error
This List is initialized by Arrys.asList(). The Arrays class inherits the AbstractList abstract class. It only implements the get/set method, but does not implement the add/remove method. Solution End
Sahua
insert image description here
. yeah yeah yeah

Guess you like

Origin blog.csdn.net/qiaojunt/article/details/125680772