I am unable to apply 10^-9 < arr[i ] < 10^9( How to use the long long while applying the constraints)

public class Sortchallenge
{
static Scanner scn=new Scanner(System.in);
public static void main(String[] args)
{
int[] array=takeinput();
System.out.println(isSorted(array, 0));
}
public static int[] takeinput()
{
System.out.println("Enter array size ");
int N=scn.nextInt();
if(N>1 && N<1000)
{
int[] arr=new int[N];
System.out.println("Enter array elements ");
for(int i=0;i<N;i++)
{
arr[i]=scn.nextInt();
}
return arr;
}
else
{
int[] base=new int[0];

        return base;
    }   
}

public static boolean isSorted(int[] arr, int i)
{
    if(arr.length-1==i)
    {
        return true;
    }
    if(arr[i]>arr[i+1])
    {
        return false;
    }
    else
    {
        boolean restAns=isSorted(arr, i+1);
        return restAns;
    }
}

}

@jdkatti Hi bro, there is no long long in java, and the constraint given are in the range of java int.
you can check the range, so you don’t need to explicitly mention these things!
Check your corrected code below!


Happy coding!