String[] strs = {"string--01", "string--02", "string--03", "string--04"};
List<String>
strsList = Arrays.asList(strs);
//以下语句输出:[string--01, string--02, string--03,
string--04]
System.out.println(strsList);
int[] ints =
{2, 3, 4, 5};
List<int[]> intsList =
Arrays.asList(ints);
//以下语句输出:[[I@c17164]
System.out.println(intsList);
Integer[]
intes = {2,
3, 4, 5};
List<Integer>
intesList = Arrays.asList(intes);
//以下语句输出:[2, 3, 4,
5]
System.out.println(intesList);
9行代码体现集合框架中的一个小细节,码迷,mamicode.com
原文地址:http://www.cnblogs.com/daojoo/p/3698858.html