How do i multiply String number1 = JOptionPane.showInputDialog(null, "number 1"
then for example im gonna multiply the value inputed on number1 to 0.16 then display it on dialog box. How should i do that?
How do i multiply String number1 = JOptionPane.showInputDialog(null, "number 1"
then for example im gonna multiply the value inputed on number1 to 0.16 then display it on dialog box. How should i do that?
You can use the methods: Double.parseDouble(String number) or Integer.parseInt(String number) to convert the number you're receiving. Both of them throws NumberFormatException so make sure to catch and handle the exception properly.