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)




免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM