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