Вот почему нельзя сделать так?Зачем использовать нудный и ненужный метод сортировки пузырьком?
public class Solution {
public static void main(String[] args) throws Exception {
ArrayList<Integer> chisla = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0; i < 5 ; i++) {
int a = Integer.parseInt(reader.readLine());
chisla.add(a);
}
Collections.sort(chisla);
System.out.print(chisla);
}
}