The method format(String, Object[]) in the type String is not applicable for the arguments (…)

后端 未结 6 1561
耶瑟儿~
耶瑟儿~ 2020-11-28 14:27

Here is my code:

int hoursFormat = 1, minsFormat = 2, secsFormat = 3;
String timeFormat = String.format(\"%02d:%02d:%02d\",hoursFormat, minsFormat, secsForma         


        
6条回答
  •  时光取名叫无心
    2020-11-28 14:59

    I had a similar problem with printf. I am using JDK 1.6.0_27. Setting the compliance level to 1.6 solved my issue. This can be set in the following way.

    Project > Properties > Java Compiler

    You can also refer to the following thread:

    Why am I getting a compilation errors with a simple printf?

提交回复
热议问题