import java.util.*;
public class Main {
static int i;
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int arr[]=new int[n];
for(i=0;i<arr.length;i++){
arr[i]=sc.nextInt();
}
int item=sc.nextInt();
indices(n,arr,item);
}
public static void indices(int n,int arr[],int item){
if(arr[i]==item){
System.out.println(item);
}
if(arr[i]==arr.length){
return;
}
indices(n-1,arr,item);
}
}
Here in this question i am getting array out of bound exception
Please share your code using coding blocks ide