symbol:method nextDouble
nextDouble"错误"
任何人都可以帮我解决这个问题吗?
double fahrenheit;
String input = JOptionPane.showInputDialog(null, "Enter the Fahrenheit degre : ");
fahrenheit = input.nextDouble();
double Celsius = 5/9 * (fahrenheit-32);
JOptionPane.showMessageDialog(null, " in Celsius : " + Celsius);
答案 0 :(得分:2)
您将String
与java.util.Scanner
混为一谈。解析从showInputDialog
fahrenheit = Double.parseDouble(input);