当前页面: 开发资料首页 → Eclipse 专题 → 为什么printf在Eclipse中有语法错误
为什么printf在Eclipse中有语法错误
摘要: 为什么printf在Eclipse中有语法错误
public class MainClass
{
/**
* @param args
*/
public static void main(String[] args)
{
// TODO Auto-generated method stub
System.out.printf("%d/n",45+56);
}
}
在命令行和netbean5中编译通过,但在Eclipse3.1中得到下列Error Message
The method printf(String, Object[]) in the type PrintStream is not applicable for the argument (String, int)
请有识之士不吝赐教。这里先谢过了。
在我的3.2M5下没有任何问题
提示这个函数,在eclipse中的原型,是没有你所写的参数。所以,该函数不可用。
咦,我也是3.1呀,这句程序是可以运行的呀,没有报错呀
我在命令行下编译也问题,用Netbean5变异也通得过,就是在Eclipse中出错。
45+56不是Object数组
ProjectPropertiesJava Compiler
改成5.0