1.Arrays.asList(T...a):作用是快速初始化一个List,Arrays.asList("AAA", "BBB", "CCC");
2.List和Set的toArray方法:将List和Set转为数组形式;
List list = Arrays.asList("A","B","C");
错误示范:String[] arr = (String[])list.toArray();
正确示范:String[] arr = new String[list.size()];
list.toArray(arr);
3.Guava的不可变集合:作用是快速初始化一个List,ImmutableList.of("AAA", "BBB", "CCC");