What am i doing wrong?

import java.util.*;
public class Main {
public static void main(String args[]) {

Scanner sc= new Scanner(System.in);
	int t=sc.nextInt();
	for(int l=0;l<t;l++) {
	int n=sc.nextInt();
	int[] arr=new int[n];
	for(int i=0;i<n;i++) {
		arr[i]=sc.nextInt();
	}
	int max=Integer.MIN_VALUE;
	int sum = 0;
	for(int i=0;i<n;i++) {
		sum=sum+arr[i];
		if(sum>max) {
			max=sum;
		}
		if(sum<0) {
			sum=0;
		}
	}
			System.out.println(sum);
	}
}

}

@laibaahsan27_1dfa992390072fd9 You should use a long variable instead of an int for array datatype, max, and sum since inputs can be very large.

it is still showing an error