I ask that I do not get direct answers, but rather hints to help me continue learning.
My task is to create an array > populate it > sort it > print unsorted and sorted.
I either end up with an arrayList that is full of the lowest number, or I run into the error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
for (int index = 0; index <= 29; index ++){
System.out.println(" I have reached the first ForLoop Sort " + index);
for (int i = 0 ; i <= midSortArray.size(); i++){
System.out.println(" I have reached the Second ForLoop Sort " + i);
if(currentInteger <= midSortArray.get(i)){
System.out.println(" If is true ");
currentInteger = midSortArray.get(i);
} else {
System.out.println("If is false");
lowestInteger = currentInteger;
sortedArray.add(0, lowestInteger);
midSortArray.remove(midSortArray.indexOf(lowestInteger));
System.out.println(sortedArray);
}
}
}