import java.io.*;
public class Example
{
  public static void main(String ards[])
  {
     long x=5678;
     System.out.println("%f",x);
  }
}我编译的时候,老是显示System.out.println("%f",x);有问题!那里出错呀~!

解决方案 »

  1.   

    System.out.printf("%f",x); 用 printf 
      

  2.   

    System.out.println("x = " + x);
      

  3.   

    System.out.printf("%f",x); 是C的写法。
      

  4.   

    System.out是个PrintStream
    看看jdk中类PrintStream的println函数,
    没有System.out.println("%f",x);这种形式
      

  5.   

    你如果要输出long型,直接System.out.println(XXX);jdk中:
     void println(long x) 
              Print a long and then terminate the line.