How can I find the sum of two numbers which are in String variables? 
<p>In this code fragment i can't sum a and b :</p>

<pre><code>String a= txtnum1.getText();
String b= txtnum2.getText(); 
JOptionPane.showMessageDialog(null,a+b);
</code></pre>

<p>...because a and b defined by String so this code work like this
if i'll give a=10 b=20 
then my output is 10+20=1020</p>

<p>how can i fix it ?</p>
