D
Size: a a a
D
D
t
D
D
D
D
D
D
t
NG
t
か
AF
6: String [] names = {"Tom", "Dick", "Harry"};
7: List<String> list = Arrays.asList();
8: list.set(0, "Sue");
9: System.out.println(names[0]);
> Sue
Почему так? Внутри листа ссылки на те же объекты, что и в массиве?l
GI
6: String [] names = {"Tom", "Dick", "Harry"};
7: List<String> list = Arrays.asList();
8: list.set(0, "Sue");
9: System.out.println(names[0]);
> Sue
Почему так? Внутри листа ссылки на те же объекты, что и в массиве?AF
return new ArrayList<>(a);
AF
GI
AF
Returns a fixed-size list backed by the specified array. Changes made to the array will be visible in the returned list, and changes made to the list will be visible in the array.