import java.text.*;public class NumberFormatText
{
public static void main(String[] args)
{
double d=562354.78;
NumberFormat n=NumberFormat.getCurrencyInstance(Locale.GERMANY);
System.out.println(n.format(d));
}
};
能帮我看看么?我是在看了《core java》第六版的第三章后写的,在没有“Locale.GERMANY”时能正常运行来着

解决方案 »

  1.   

    NumberFormatText.java:8: 找不到符号
    符号: 变量 Locale
    位置: 类 NumberFormatText
    NumberFormat n=NumberFormat.getCurrencyInstance(Locale.GERMANY);
                                                                    ^
    1 错误
      

  2.   

    import java.text.*;如果你的import只有这一行的话
    你还要导入NumberFormat这个类
      

  3.   

    NumberFormat类就是属于java.text包的啊
      

  4.   

    Locale.GERMANY
    难道这个才是得继续引用另一个类?
      

  5.   

    哦,应该是导入Locale类吧,说错了,报错是找不到Locale
    java.util.Locale