I tried running this code on a PC and it works fine. Why doesn't it work on Codegym? It keeps giving me an error message for Arrays.sort(arr);
package com.codegym.task.task04.task0420;
/*
Sorting three numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int numbers = Integer.parseInt(reader.readLine());
int arr[] = new int[numbers];
for(int i=0; i<numbers; i++){
System.out.println("Number " + (i + 1) + ": ");
arr[i] = Integer.parseInt(reader.readLine());
}
for(int i = arr.length - 1; i >= 0; i--) {
Arrays.sort(arr);
System.out.print(" " + arr[i]);
}
}
}