Something like -
for(int i = 0; i < mydata.length/2; i++) { int temp = mydata[i]; mydata[i] = mydata[mydata.length - i - 1]; mydata[mydata.length - i - 1] = temp; }