What is the mistake in the below code?
import java.util.*;
public class Main {
public static void main(String args[]) {
// Your Code Here
Scanner sc = new Scanner(System.in);
int size = sc.nextInt();
List arr = new ArrayList<>();
for(int i =0; i<size; i++){
arr.add(sc.nextInt());
}
System.out.println(isSorted(arr));
}
private static boolean isSorted(List arr){
if(arr.size()==1){
return true;
}
if(arr.get(0) > arr.get(1)){
return false;
}
else{
arr.remove(0);
isSorted(arr);
return true;
}
}
}