 <p>Assuming you want to add the result <code>z</code> from each method:</p> <pre><code>static int number1(){ int x, y, z; x=2; y=2; z=x+y; return z; } static int number2(){ int x, y, z; x=3; y=2; z=x+y; return z; } </code></pre> <p>You could simplify this though to a more generic method:</p> <pre><code>static int adder(int a, int b) { return a + b; } public static void main (String [] args){ p = adder(2, 2) + adder(3, 2); } </code></pre>