Please check the commented line(code lineno. 24)

import java.util.Scanner;

import javax.lang.model.util.ElementScanner14;

public class isSorted
{
static Scanner scn=new Scanner(System.in);
public static void main(String[] args)
{
int[] array=takeinput();
System.out.println(isSorted(array, 0));
} 3
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(); // how to apply 10^-9<arr[i]<10^9?

        }
        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 bro if your talking about this, than this is not your concern, basically those inputs are given from test cases to you. Just that you have to check what is the range of constraints and if the range is long then you have to take long.

So that’s it about the constraint part.

If your query is resolved mark it resolved else feel free to ask!
Happy Coding!

Then, should I use Long While reading the array elements?

@jdkatti bro that is according to the constraints, if you think that it fits in int then int will be good, also read more about how to take inputs on online judges buddy!

Help me out with,
What is wrong with my above code?