try {
int a = Integer.parseInt(fristNumber.getText());
int b = Integer.parseInt(scendNumber.getText());
int c = a + b;
int d = a - b;
int g = a * b;
int f = a / b; String he = Integer.toString(c);//这里说的转换类型不正确
String cha = Integer.toString(d);//这里说的转换类型不正确
String ji = Integer.toString(g);//这里说的转换类型不正确
String chu = Integer.toString(f);//这里说的转换类型不正确 if (jRadioButton1.isSelected()) {
las.setText(he);
} else if (jRadioButton2.isSelected()) {
las.setText(cha);
} else if (jRadioButton3.isSelected()) {
las.setText(ji);
} else if (jRadioButton4.isSelected()) {
las.setText(chu);
}
} catch (NumberFormatException ne) {
JOptionPane.showMessageDialog(null, "请输入数字!", "Error",
JOptionPane.ERROR_MESSAGE); }
}
错误是:
"data.java": incompatible types; found : java.lang.String, required: com.sun.org.apache.xpath.internal.operations.String at line 110, column 31高手帮忙修改下,我已经都修改过很多地方,但是还是不行,帮帮忙,小弟谢过!
int a = Integer.parseInt(fristNumber.getText());
int b = Integer.parseInt(scendNumber.getText());
int c = a + b;
int d = a - b;
int g = a * b;
int f = a / b; String he = Integer.toString(c);//这里说的转换类型不正确
String cha = Integer.toString(d);//这里说的转换类型不正确
String ji = Integer.toString(g);//这里说的转换类型不正确
String chu = Integer.toString(f);//这里说的转换类型不正确 if (jRadioButton1.isSelected()) {
las.setText(he);
} else if (jRadioButton2.isSelected()) {
las.setText(cha);
} else if (jRadioButton3.isSelected()) {
las.setText(ji);
} else if (jRadioButton4.isSelected()) {
las.setText(chu);
}
} catch (NumberFormatException ne) {
JOptionPane.showMessageDialog(null, "请输入数字!", "Error",
JOptionPane.ERROR_MESSAGE); }
}
错误是:
"data.java": incompatible types; found : java.lang.String, required: com.sun.org.apache.xpath.internal.operations.String at line 110, column 31高手帮忙修改下,我已经都修改过很多地方,但是还是不行,帮帮忙,小弟谢过!
String的import有问题吧? 应该是java.lang.String, 不是com.sun.org.apache.xpath.internal.operations.String