以下实例演示了使用 Java Util 类的 Arrays.asList(name) 方法将数组转换为集合:
ArrayToCollection.java 文件
以上代码运行输出结果为:
0 1 2 3 4