Variables inside methods
<p>I have this method:</p>

<pre><code>public String Nov2()
{
    String[] ops = new String[] {" + ", " - ", " * ", " / "};
    int i = rand.nextInt(4-0) + 0;
    String op1 = ops[i];

    int novnum1 = rand.nextInt(101-1) + 1;

    int novnum2 = rand.nextInt(101-1) + 1;


    String novnum1str = Integer.toString(novnum1);

    String novnum2str = Integer.toString(novnum2);

    String nov2Exp = novnum1str + op1 + novnum2str + " = ";

    setContentView(R.layout.gameview);

    TextView display = (TextView) findViewById(R.id.exp);

    display.setText(nov2Exp);

    return nov2Exp;
}
</code></pre>

<p>It returns the string nov2Exp, but what i want to do is actually work out the expression this method generates. novnum1 and novnum2 are my two terms and op1 supplies the operation, how could i make the result of the expression accesible to the rest of the program from this method?</p>
