How to use parseInt?
807999Nov 13 2010 — edited Nov 15 2010I have the following code that fails:
public class AdditionDialogTest {
public static void main( String[] args ){
//Force the user to enter a number
String number1 =
JOptionPane.showInputDialog("Enter fisrt number");
num1 = public static int parseInt(String number1);
}
}
I want to transorm a String number typed by the user into an integer. THe code I want to create has to enter 2 numbers into two dialog boxes and then appear their addition into a
third box using the String message = String.format( "The result of the addition is %d", additionResult ); and JOptionPane.showMessageDialog( null, message );
Please list a code
Thanks
Alexandros
Edited by: 804996 on 13-Nov-2010 08:16