Hi,
I am a beginner in Java and I am currently learning about JOption pane. I have this below question plz.
Using Strings I am accepting an input from the user and by using the Interer.ParseInt(variable) option I am able to multiply this two strings using the code below.
String Length; Length = JOptionPane.showInputDialog("Enter the Length"); String Breadth; Breadth = JOptionPane.showInputDialog("Enter the Breadth"); System.out.println(" Area is " + (Integer.parseInt(Breadth) * Integer.parseInt(Length))); System.exit(0);
Now My question is... How Do I make my code accept Decimal values. E.g. My Code should accept 10.02 as Length and 20.42 as Breadth and give the product a Decimal. How Do I do this???
Appreciate the help.