JPane から double を取得できないため、文字列を Double に変更しようとしています。オブジェクトが初期化されていないというエラーが表示されます。どうすれば修正できますか?
import javax.swing.JOptionPane;
public class jwindows {
public static void main (String args[]) {
double a, b, c;
double sum = a + b + c;
double product = a * b * c ;
double avarge = a * b * c / 3;
String stringA = JOptionPane.showInputDialog
(null, "Please enter first number");
a = Double.parseDouble(stringA);
String stringB = JOptionPane.showInputDialog
(null, "Please enter second number: ");
b = Double.parseDouble(stringB);
String stringC = JOptionPane.showInputDialog
(null, "Please enter third number: ");
c = Double.parseDouble(stringC);
JOptionPane.showInternalMessageDialog
(null, "The sum of the 3 numbers is " + sum);
JOptionPane.showInternalMessageDialog
(null, "The avarge of the 3 numbers is " + avarge);
JOptionPane.showInternalMessageDialog
(null, "The sum of the 3 numbers is " + product);
}
}