1. 程式人生 > >Java System.arraycopy()

Java System.arraycopy()

//src源陣列  srcPos複製起始位置  dest目的陣列  destPos放置起始位置  length複製長度

System.arraycopy(Object src, int srcPos, Object dest, int destPos, int length);

例項:

String[] one = new String[]{"aa", "bb", "cc", "dd"};

String[] two = new String[]{"11", "22"};

System.arraycopy(one, 1, two, 1, 1);

two = {"11", "bb"};