second largest digit in array : <p>We have to use an array as input and are supposed to output the second maximum element in it.</p>

<p>For instance if our input is a[]=10 20 30 40 50 60 70, the program should return 60. I've heard it's a very basic problem but I am new to java programming and can't figure it out.</p>

<p>Also, all elements are unique.</p>

<p>I've tried this so far and don't know how to proceed:</p>

<pre><code>import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {


     public static int SecondLargest(int[] arr) {
        int maxValue = arr[0];
        for (int i = 1; i &lt; arr.length; i++) {
            if (arr[i] &gt; maxValue) {
                maxValue = arr[i];
            }
        }
        return maxValue;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();

    }
}
</code></pre>
