yearInterestRate=JOptionPane.showInputDialog(null, "请输入年利率:","输入提示!",JOptionPane.QUESTION_MESSAGE);
//将字符型的变量转换成double型
Double.parseDouble(yearInterestRate);
//计算月利率
monthlyInterestRate=yearInterestRate/12;//为什么这一步出错,提示如下
The operator / is undefined for the argument type(s) String, int
怎么解决?
比如我可以改为monthlyInterestRate=Double.parseDouble(yearInterestRate)/12,但感觉不爽,就想不它彻底转换成字符,怎么做
那怎样把它变成字符串呢
我就想把它转换了