Eclipse中使用printf报错 提示参数类型不对 已解决The method printf(String, Object[]) in the type PrintStream is not ap

引用:https://blog.csdn.net/chenhao0568/article/details/52233783

Eclipse中 JAVA默认的兼容版本为1.4, 改为1.5及以上版本就行。 项目 》属性》Java complier》complier compliance lever:1.5

 

 

 

System.out.printf("%f",d);//"f"表示格式化输出浮点数。

就正常了。

 

1.4版本 中 printf参数类型不一样,所以报错。

The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (String, int)



posted @ 2019-05-22 13:50  油腻叔叔  阅读(3521)  评论(0编辑  收藏  举报