For this Question: Given an array of n integers. Print the second maximum difference between any two numbers in the array.First line contains n.
Next line contains n space separated integers. 

<b>Constraints </b>
3 <= n <= 10<sup>5</sup>
1 <= arr[i] <= 10<sup>9</sup>A single integer denoting the answer.Input:
5
3 1 4 6 9

Output:
6

Explanation :
Difference between 1 and 9 is 8.
Difference between 3 and 9 is 6., I have written this Solution Code: import java.io.*;
import java.util.*;


public class Main {
    
   
    
    public static void main(String[] args) {
        
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        
        int n=Integer.parseInt(in.next());
       
        int a[] = new int[n];
        for(int i=0;i<n;i++){
            a[i] = Integer.parseInt(in.next());
        }
        
        Arrays.sort(a);
        int x=a[n-1] - a[1];
        int y=a[n-2] - a[0];
        
        out.print(Math.max(x,y));
        out.close();
    }

    
    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?