// public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
public class Example {
public static void main(String[] args) {
char[] formArray = { 'a', 'b', 'c', 'd', 'e', 'f', 'g'};
int N = 4;
char[] toArray = new char[N];
System.arraycopy(formArray, 2, toArray, 0, N);
for (char ch : toArray) {
System.out.println(ch);
}
}
}
/*
run:
c
d
e
f
*/