import java.util.*; public class Select{ public void getSelect(int[] array){ if(array == null || array.length == 0) return; for(int i=0;i<array.length-1;i++){ int index = i; int j=0; for(j=i+1;j<array.length;j++){ if(array[j]<array[index]){ index = j; } } int temp = array[index]; array[index] = array[i]; array[i] = temp; } } public static void main(String[] args){ int[] array = {9,8,7,6,5,4,3,2,1}; Select s = new Select(); s.getSelect(array); System.out.println(Arrays.toString(array)); } }