Почему не могу отсортировать и вывести результат сортировки?
package com.javarush.task.task10.task1020;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Задача по алгоритмам
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[11];
for (int i = 0; i < 11; i++) {
array[i] = Integer.parseInt(reader.readLine());
}
for (int i = 1; i < array.length; i++){
for (int j = array.length-1; j < i ; j--) {
int temp;
if (array[j] > array[i]){
temp = array[j];
array[j] = array[i];
array[i] = temp;}
}
}
for (int i : array){
System.out.println(i);}
// System.out.println(array[9]);
// System.out.println(array[10]);
}
// public static void sort(int[] array) { }
}