Sorting using multiple methods


sort() – Perform a selection sort. Make sure you call the next two methods.

indexOfSmallestElement() – Return the index of the next element in ascending order.

swap() – Exchange the two values at the specified indices.


I have to sort 3 different kinds of arrays, ints, characters, and strings. How would I use the indexOfSmallestElement and swap inside of my sort method. I am thinking I would just replace some of the variables in my for loop with method calls but I have not had any success. swap is what is giving me the most trouble, I do not know how to implement this into my method.