We often use the same methods over and over again. To make it easier to reuse these, we create utility classes which are a collection of useful methods centered around a common theme. For example, ...
int LastElementIndex = arr.length-i-1; //index of last Element after each step int MaxIndex = MaxIndex(arr,0,LastElementIndex); // index of maximum value, in the remaining unsorted array ...