Find values that add up to a number
Lack of separation of concerns

You have a single main function that:


Reads a String and parses it to an internal format
Applies logic to it (finds numbers that sum to the target)
Pretty prints the result


You should have at least 3 more functions:

public class NumPairs {

    // Pseudocode, to return two objects at once read 
    // http://stackoverflow.com/questions/457629/how-to-return-multiple-objects-from-a-java-method 
    public static (int[], int) parseInput(String input) {

    }

    public static int[][] sumsTo(int[] list, int result) {

    }

    public static String prettify(int[][] result) {

    }

    public static void main(String[] args) {
        // Simply use the other functions
    }

}


You may still need to subdivide sumsTo surther.