Write a recursive function which prints true if the array is sorted in Increasing Order, and false otherwise

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;
}
}
}

@jeevika32_7f86c13248dfa5c9

public static void main(String args[]) {
	// Your Code Here
	Scanner sc = new Scanner(System.in);
	int size = sc.nextInt();
	List<Integer> arr = new ArrayList<>();
	for (int i = 0; i < size; i++) {
		arr.add(sc.nextInt());
	}
	System.out.println(isSorted(arr));
}

private static boolean isSorted(List<Integer> arr) {
	if (arr.size() == 1) {
		return true;
	}
	if (arr.get(0) > arr.get(1)) {
		return false;
	} else {
		arr.remove(0);
		return isSorted(arr);
	}
}

Actually in last line of the code you don’t need to return true because the answer will depend on the recursive call. According to your code it will return true and there is no effect of recursive calls on the answer. Check the correct code attached here.