Error in code written by me

written code but there is an error

import java.util.Scanner;
public class Main
{
public static void main (String[]args)
{
int[] array = { 2, 5, 7, 9, 8 };
System.out.println (maxarray (array));
}

public static int maxarray (int[]arr)
{
int max = Integer.MIN_VALUE;
for (int i = 0; i < arr.length; i++)
{
if (arr[i] > max)
{
max = arr[i];
}
return max;
}
}
}

@abhileshbirru7_eace4554a0cae2c1 dont give space after writing println. remove the space.