I would like to fill an array using consecutive integers. I have created an array that contains as much indexes as the user enters:
Scanner in = new Scanner(
One more thing. If I want to do the same with reverse:
int[] array = new int[5]; for(int i = 5; i>0;i--) { array[i-1]= i; } System.out.println(Arrays.toString(array)); }
I got the normal order again..