I am not able to find the error in the below mentioned program. Please do help me with this

import java.util.Scanner;

public class Arraymax
{
static Scanner scn=new Scanner(System.in);
public static void main(String [] args)
{
int[] array=takeinput();
display(array);

     System.out.println("Largest element in the array is "+maxinArray(arr));
    

}
public static int[] takeinput()
{
    System.out.println("Enter the size of the array ");
    int n=scn.nextInt();
    int[] arr=new int[n];
    for(int i=0;i<arr.length;i++)
    {
        System.out.println("Enter the value for "+i+" index");
        arr[i]=scn.nextInt();
    }
    return arr;
}
public static void display(int[] arr)
{
    System.out.println("Elements of the arrasy are ");
    for(int i=0;i<arr.length;i++)
    {
        System.out.println(arr[i]);
    }
}


public static int maxinArray(inr[] arr)
{
    // initialising max to infinity
    int max= Integer.MIN_VALUE;
    for(int i=0;i<arr.length;i++)
    {
        if(arr[i]>max)
        {
            max=arr[i];
        }
    }
    return max;
}

}

hey @jdkatti
just a changes in Main function
System.out.println("Largest element in the array is "+maxinArray(array)); // instead of System.out.println("Largest element in the array is "+maxinArray(arr));

Sir I am again stuck at the error : Unable to initialize main class Arraymax

Are you submitting this code on hacker blocks?

import java.util.Scanner;

public class Arraymax

{

static Scanner scn=new Scanner(System.in);

public static void main(String [] args)

{

    int[] array=takeinput();

    display(array);

     System.out.println("Largest element in the array is "+maxinArray(array));

    

}

public static int[] takeinput()

{

    System.out.println("Enter the size of the array ");

    int n=scn.nextInt();

    int[] arr=new int[n];

    for(int i=0;i<arr.length;i++)

    {

        System.out.println("Enter the value for "+i+" index");

        arr[i]=scn.nextInt();

    }

    return arr;

}

public static void display(int[] arr)

{

    System.out.println("Elements of the arrasy are ");

    for(int i=0;i<arr.length;i++)

    {

        System.out.println(arr[i]);

    }

}



public static int maxinArray(inr[] arr)

{

    // initialising max to infinity

    int max= Integer.MIN_VALUE;

    for(int i=0;i<arr.length;i++)

    {

        if(arr[i]>max)

        {

            max=arr[i];

        }

    }

    return max;

}

}

public static int maxinArray(int[] arr) instead of public static int maxinArray(inr[] arr)

Got it.
Thank you sir