I have a problem with creating reverse ordered array. Here is the code that I wrote:
public static int[] makeReverse(int number) {
int[] rorder = new int[number];
int j = rorder.length;
for (int i = 0; i < rorder.length-1; i++) {
rorder[j] = i;
j--;
}
return rorder;
But when I try to run it I got java.lang.ArrayIndexOutOfBoundsException
error. I couldn't find the error.