In this code fragment, I can\'t sum a and b:
a
b
String a = \"10\"; String b = \"20\"; JOptionPane.showMessageDialog(null,a+b);
Because you want to concat Strings they won't add up. You have to parse them to an Integer which works like:
Integer.parseInt(a) + Integer.parseInt(b)
To sum this up + concats Strings and doesn't add them up.