I have created a list from Arrays.asList and while manipulating that list I am getting UnsupportedOperationException, both at list.add() and list.remove() methods.
What is the problem with the code and how to fix this?
final Long[] arr = {1.0L, 2.0L};
List myNewList = Arrays.asList(someArrayOfLong);
myNewList.add(new Long(3)); //add an element in the list.
myNewList.remove(0); //remove element from the list at index 0.