<legend id='Oi9S7'><style id='Oi9S7'><dir id='Oi9S7'><q id='Oi9S7'></q></dir></style></legend>

<tfoot id='Oi9S7'></tfoot>

<small id='Oi9S7'></small><noframes id='Oi9S7'>

    <i id='Oi9S7'><tr id='Oi9S7'><dt id='Oi9S7'><q id='Oi9S7'><span id='Oi9S7'><b id='Oi9S7'><form id='Oi9S7'><ins id='Oi9S7'></ins><ul id='Oi9S7'></ul><sub id='Oi9S7'></sub></form><legend id='Oi9S7'></legend><bdo id='Oi9S7'><pre id='Oi9S7'><center id='Oi9S7'></center></pre></bdo></b><th id='Oi9S7'></th></span></q></dt></tr></i><div id='Oi9S7'><tfoot id='Oi9S7'></tfoot><dl id='Oi9S7'><fieldset id='Oi9S7'></fieldset></dl></div>

      • <bdo id='Oi9S7'></bdo><ul id='Oi9S7'></ul>
    1. String 类型中的方法 format(String, Object[]) 不适用于参数 (...)

      The method format(String, Object[]) in the type String is not applicable for the arguments (...)(String 类型中的方法 format(String, Object[]) 不适用于参数 (...))

      <small id='0prz7'></small><noframes id='0prz7'>

      <legend id='0prz7'><style id='0prz7'><dir id='0prz7'><q id='0prz7'></q></dir></style></legend>
            <i id='0prz7'><tr id='0prz7'><dt id='0prz7'><q id='0prz7'><span id='0prz7'><b id='0prz7'><form id='0prz7'><ins id='0prz7'></ins><ul id='0prz7'></ul><sub id='0prz7'></sub></form><legend id='0prz7'></legend><bdo id='0prz7'><pre id='0prz7'><center id='0prz7'></center></pre></bdo></b><th id='0prz7'></th></span></q></dt></tr></i><div id='0prz7'><tfoot id='0prz7'></tfoot><dl id='0prz7'><fieldset id='0prz7'></fieldset></dl></div>
          1. <tfoot id='0prz7'></tfoot>
              <bdo id='0prz7'></bdo><ul id='0prz7'></ul>
                <tbody id='0prz7'></tbody>

                本文介绍了String 类型中的方法 format(String, Object[]) 不适用于参数 (...)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                这是我的代码:

                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)
                

                为什么会出现此错误,我该如何解决?

                Why am I getting this error here and how can I fix it?

                推荐答案

                我遇到了类似的 printf 问题.我正在使用 JDK 1.6.0_27.将合规级别设置为 1.6 解决了我的问题.这可以通过以下方式设置.

                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.

                项目 > 属性 > Java 编译器

                Project > Properties > Java Compiler

                你也可以参考下面的帖子:

                You can also refer to the following thread:

                为什么会出现编译错误用一个简单的 printf?

                这篇关于String 类型中的方法 format(String, Object[]) 不适用于参数 (...)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                  <tfoot id='OCxye'></tfoot>
                    <bdo id='OCxye'></bdo><ul id='OCxye'></ul>
                      <tbody id='OCxye'></tbody>
                    <i id='OCxye'><tr id='OCxye'><dt id='OCxye'><q id='OCxye'><span id='OCxye'><b id='OCxye'><form id='OCxye'><ins id='OCxye'></ins><ul id='OCxye'></ul><sub id='OCxye'></sub></form><legend id='OCxye'></legend><bdo id='OCxye'><pre id='OCxye'><center id='OCxye'></center></pre></bdo></b><th id='OCxye'></th></span></q></dt></tr></i><div id='OCxye'><tfoot id='OCxye'></tfoot><dl id='OCxye'><fieldset id='OCxye'></fieldset></dl></div>

                    • <legend id='OCxye'><style id='OCxye'><dir id='OCxye'><q id='OCxye'></q></dir></style></legend>

                      <small id='OCxye'></small><noframes id='OCxye'>