Fading Coder

One Final Commit for the Last Sprint

The Subtle Differences in toArray() Behavior Between ArrayList and Arrays.asList

Consider the following code snippet: List<String> list = new ArrayList<>(); list.add("1"); Object[] array = list.toArray(); array[0] = 1; System.out.println(Arrays.toString(array)); This executes without error. However, modifying the code to use Arrays.asList leads to an ArrayS...