hashmap.remove() throwing exception unsupported operation code example

Example: java.lang.UnsupportedOperationException

From the API:
'Arrays.asList': Returns a fixed-size list backed by the specified array.

You cant add to it.
You cant remove from it.
You cant structurally modify the List.

Create new instance of any type that implement List interface,
pass Arrays.asList(...) to parameter:
  
List<String> list = new LinkedList<String>(Arrays.asList(split));

Tags:

Java Example