For this Question: Ram is given an array <b>A</b> of length N, Ram can right-rotate the array any number of times (possibly zero times also). His task is to find out the maximum value of A<sub>1</sub> + A<sub>N</sub>.
<b>Note</b>: Right rotation of array [A<sub>1</sub>, A<sub>2</sub>,. , A<sub>N</sub>] is [A<sub>N</sub>, A<sub>1</sub>,. , A<sub>N-1</sub>].The first line of the input contains a single integer T, denoting the number of test cases.
The first line of each test case contains a single integer N, denoting the size of an array A.
The second line of each test case contains N space- separated integers denoting array A.

<b>Constraints</b>
1 &le; T &le; 1000
1 &le; N &le; 10<sup>5</sup>
1 &le; A<sub>i</sub> &le; 10<sup>9</sup>For each test case output on a new line denoting the maximum value of A<sub>1</sub> + A<sub>N</sub>.Sample Input 
3
2
5 8
3
5 10 15
4
4 4 4 4
Sample Output
13
25
8, I have written this Solution Code: import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		for(int i=0;i<t;i++){
		int n = sc.nextInt();
		int a[] = new int[n];
		int max=0;
		for(int j=0;j<n;j++){
		    a[j] = sc.nextInt();
		}
		for(int j=0;j<n-1;j++){
		    if(max<a[j]+a[j+1]){
		        max=a[j]+a[j+1];
		  
		    }
		}
		
		if(max<a[0]+a[n-1]){
		    max=a[0]+a[n-1];
		}
		System.out.println(max);
		}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?