public class MoveArray {
public static void main(String[] args) {
int[] arr = {1,2,3};
arr = moveArray(arr);
for(int i=0;iSystem.out.print(arr[i]+" ");
}
}
public static int[] moveArray(int[] arr){
int[] returnArr = new int[arr.length];
if(returnArr.length<1) return new int[0];
for(int i=0;ireturnArr[i] = arr[i+1];
}
returnArr[arr.length-1] = arr[0];
return returnArr;
}
}