Is this right!! Java Swing
import javax.swing.JOptionPane;
public class Addition_GUI
{
public static void main(String args[])
{
String firstInt;
String secondInt;
firstInt = JOptionPane.showInputDialog("Enter the First Integer value :");
Integer num1 = Integer.parseInt(firstInt);
secondInt = JOptionPane.showInputDialog("Enter the Second Integer value :");
Integer num2 = Integer.parseInt(secondInt);
Integer sum = num1 + num2;
String result = String.format("The sum is : %s",sum);
JOptionPane.showMessageDialog(null,result);
}
}
It didn't give any errors. But, I need a explanation. Please help me.