这段代码出了什么问题?
private void jButtonConvActionPerformed(java.awt.event.ActionEvent evt) {
double Algerian_Dinars = Double.parseDouble(jtxtConvert.getText());
if (jCombCrrency.getSelectedItem().equals("USA"))
{
double US_Dollar = 0,00905365; /*here is the error???*/
String cconvert1 = String.format("N%.2f",Algerian_Dinars * US_Dollar);
jlblConvert.setText(cconvert1);
答案 0 :(得分:0)
您不能在Java中使用双打逗号。
double US_Dollar = 0,00905365;
^
我假设你错过了小数而不是像:
double US_Dollar = 0.00905365;