常用备注 一.LIst to Array List<String> list = new ArrayList<String>(); Object[] array=list.toArray(); 上述方法存在强制转换时会抛异常,下面此种方式更推荐:可以指定类型 String[] array=list.toArray(new String[list.size()]); 二.Array To List 最简单的方法似乎是这样 String[] array = {"java&qu…
public class Shuzufuzhi { public static void main(String args[]) { int myArray[]={1,2,3,4,5,6}; int yourArray[]={10,9,8,7,6,5,4,3,2,1}; int Array3 []=new int [myArray.length+yourArray.length]; System.arraycopy(myArray, 0,Array3,0,myArray.length…
public class Test { public static void main(String[] args) { Integer[] a = {1,2,3}; Integer[] b = {4,5,6}; Integer[] c = new Integer[a.length+b.length]; System.arraycopy(a, 0, c, 0, a.length); System.arraycopy(b, 0, c, b.length, b.length); for(Intege…