You never reset your index value for your outer loop so it will re-evaluate each inner loop based upon the next found max number. Some pointers
1) Arrays.sort() is much easier and much faster for...