为什么eclips3.2下编译会提示错误,错误信息:“The method parseDouble(String) is undefined for the type Double”
别人的机器上能运行,我的机器上int类型可以,但换成double就错,为什么,求指教。先在此感谢。代码如下:
import javax.swing.JOptionPane;
public class G {
public static void main(String[] args){
String stra = JOptionPane.showInputDialog(null,"x","y",JOptionPane.QUESTION_MESSAGE);
double a = Double.parseDouble(stra);
}
}
别人的机器上能运行,我的机器上int类型可以,但换成double就错,为什么,求指教。先在此感谢。代码如下:
import javax.swing.JOptionPane;
public class G {
public static void main(String[] args){
String stra = JOptionPane.showInputDialog(null,"x","y",JOptionPane.QUESTION_MESSAGE);
double a = Double.parseDouble(stra);
}
}
楼主,这是jdk版本的问题!