Find pair in array with maximum sum using recursion
Notice that the answer is the sum of the two greatest elements in the array. You only need one pass to find both of them.
The idea is that you go from through the array and keep track of top 2 elements in the array. The code will be simplier if the function requires to be called on a valid input data (an array of length &gt;= 2) and first two elements already compared. The function then takes the next element of the array, updates the top 2 pair and moves onto the next element.
I assume you have to use recursion, but the code could be easily rewritten using a loop.
public static void findSum(int[] a, int greatest, int secondGreatest, int currentIndex) {
    if (currentIndex == a.length) {
        System.out.println(&quot;Sum:&quot; + (a[greatest] + a[secondGreatest]) + &quot;, i:&quot;+greatest+&quot;,j:&quot;+secondGreatest);
        return;
    }
    if (a[currentIndex] &gt; a[greatest]) {
        // found the new top; the current top becomes the second
        secondGreatest = greatest;
        greatest = currentIndex;
    } else if (a[currentIndex] &gt; a[secondGreatest]) {
        // found the new second-greatest, but so the current top stays the same
        secondGreatest = currentIndex;
    }
    findSum(a, greatest, secondGreatest, currentIndex + 1);
}

And the usage would be:
if (a.length &gt;= 2) {
    // Rank the first two elements in the array and initiate the recursion
    int greatest = a[0] &gt; a[1] ? 0 : 1;
    int secondGreatest = greatest == 0 ? 1 : 0;
    findSum(a, greatest, secondGreatest, 2);
}