Im trying to split an array, store one part in one array and the other part in another array. Then im trying to flip the 2 and store them in a new array. here is what i have
public int[] flipArray(){
int value = 3;
int[] temp1 = new int[value];
int[] temp2 = new int[(a1.length-1) - (value+1)];
int[] flipped = new int[temp1.length+temp2.length];
System.arraycopy(a1, 0, temp1, 0, value);
System.arraycopy(a1, value+1, temp2, 0, a1.length-1);
System.arraycopy(temp2, 0, flipped, 0, temp2.length);
System.arraycopy(temp1, 0, flipped, temp2.length, temp1.length);
return flipped;
}
private int[]a1={1,2,3,4,5,6,7,8,9,10};