Unable to get output for sort Array

when I am running code on eclipse it working fine. But while submitting code I am getting error on testcases.

You may be missing corner test cases. Please share your code so I can help you more

public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();

        int[] arr = {1,2,3,4,5};
		System.out.println(sortArray(arr,n));
    }

	public static boolean sortArray(int[] arr,int n){

        if(n==1){
            return true;
        }
        return arr[n-1]>arr[n-2]&&sortArray(arr,n-1);
	}

Have you taken input for array properly? Because it is hard-coded in the code that you have shared. Secondly, you have not considered the case when there are multiple same elements in the array (1, 2, 3, 4, 4, 6). This array is also sorted. And you should put base case condition as (n==1 || n==0), just in case the input array is empty.

Hi still unable to get ouput

public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();

        int[] arr = new int[n];

        for(int i=0;i<n;i++){
            arr[i] = sc.nextInt();
        }

        System.out.println(sortArray(arr,n));

    }

	public static boolean sortArray(int[] arr,int n){

        if(n==0){
            return false;
        }
        if(n==1){
            return true;
        }
        return arr[n-1]>arr[n-2]&&sortArray(arr,n-1);

}

Testcase 2 is giving wrong answer