Code failing testcase 2 or neg test cases

import java.util.*;
public class Main {
public static Boolean sorted_arr(int arr[] , int si){
if(si == arr.length -1)
return true ;

	if(arr[si] > arr[si+1])
	return false ;
	
    Boolean ans = sorted_arr(arr , si+1);
	return ans;
}
public static void main(String args[]) {
int arr[] = {-1 , -2 ,  -4, -5};
System.out.println(sorted_arr(arr , 0));
}

}

As far as i have checked this code for neg values it is workign could u please correct my code if am missing something

Hey @rahul1402 You have hard coded the array take input from user than use that array.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.