public <T> T reverse(T[] arr){
int start = 0;
int end = arr.length-1;
while(true){
if(start>=end){
break;
}
T temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
start++;
end--;
}
return (T) arr;
}
@Test
public void test(){
int[] arr = {2,6,3};
for(int i : reverse(arr)){
System.out.println(i);
}