Is this for class and you have to make your own sort?

If not, you can simply say:

Arrays.sort(myArray);

and your array will be sorted.