1.java.lang.unsupportedoperationexception
An exception occurred in the project with an empty collection in collections Collections.emptylist () when added:
List<car> carlist= collections.emptylist ();
Reported errors are as follows:
Java.lang.UnsupportedOperationException
At Java.util.AbstractList.add (abstractlist.java:131)
At Java.util.AbstractList.add (abstractlist.java:91)
...........
The JDK API is interpreted as follows:
Java.lang.CloneNotSupportedException
Cloning exceptions are not supported. When the Cloneable interface is not implemented or the Clone method is not supported, the exception is thrown by calling its clone () method.
When Carlist executes Remove,add method, this exception is thrown, to see the source can be learned that Emptylist does not provide the add and remove methods
WORKAROUND: It is recommended to use list<car> Carlist = new arraylist<car> ();
Java Exception Rollup