selection sort written in java