public static void main(String[] args){

        int[] array={9,8,7,6,5};

        for (int i = 0; i < array.length; i++) {
            int temp=array[i];
            for (int j = 0; j < i; j++) {
                if (temp < array[j]) {
                    int swapTemp=array[j];
                    array[j]=array[i];
                    array[i]=swapTemp;
                }
            }
        }
        System.out.println(Arrays.toString(array));

    }