【发布时间】:2011-12-03 19:57:01
【问题描述】:
这是我的代码:
int hoursFormat = 1, minsFormat = 2, secsFormat = 3;
String timeFormat = String.format("%02d:%02d:%02d",hoursFormat, minsFormat, secsFormat);
这会导致编译错误:
Unresolved compilation problem:
The method format(String, Object[]) in the type String is not applicable for the
arguments (String, int, int, int)
为什么会出现此错误,我该如何解决?
【问题讨论】:
-
您使用的是什么 JDK 品牌/版本?你用的是什么IDE? IDE 项目的 Java 合规级别版本设置为多少?
-
您使用的是什么版本的 Java?如果您使用的是 Eclipse 之类的 IDE,Java 编译器设置的合规级别是多少? 编辑:太慢了!该死的巴鲁斯! :)
-
合规水平——我敢打赌就是这样。