The code below will throw UnsupportedOperationException
in java :
String[] arr = {"a", "b", "c"};
List<String> list = Arrays.asList(arr);
list.add("d");
I'm a little confused isn't this an ISP violation ? Here class implements the List
interface but can't implement its method add()