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

后端 未结 6 1575
耶瑟儿~
耶瑟儿~ 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 15:14

    The signature of format is:

    public static String format(String format, Object ... args) {
        return new Formatter().format(format, args).toString();
        }
    

    and it seems no any mistakes in your code, for my suggestion try to run this with console application without using any IDE (For test purpose).

提交回复
热议问题