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

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

        • <bdo id='LBTYe'></bdo><ul id='LBTYe'></ul>

        <tfoot id='LBTYe'></tfoot>
      1. <legend id='LBTYe'><style id='LBTYe'><dir id='LBTYe'><q id='LBTYe'></q></dir></style></legend>
      2. 类型不匹配:无法从整数转换为布尔值

        时间:2023-07-27

            <tbody id='O3GM9'></tbody>
            <bdo id='O3GM9'></bdo><ul id='O3GM9'></ul>
            <tfoot id='O3GM9'></tfoot>
          • <small id='O3GM9'></small><noframes id='O3GM9'>

                <i id='O3GM9'><tr id='O3GM9'><dt id='O3GM9'><q id='O3GM9'><span id='O3GM9'><b id='O3GM9'><form id='O3GM9'><ins id='O3GM9'></ins><ul id='O3GM9'></ul><sub id='O3GM9'></sub></form><legend id='O3GM9'></legend><bdo id='O3GM9'><pre id='O3GM9'><center id='O3GM9'></center></pre></bdo></b><th id='O3GM9'></th></span></q></dt></tr></i><div id='O3GM9'><tfoot id='O3GM9'></tfoot><dl id='O3GM9'><fieldset id='O3GM9'></fieldset></dl></div>
                  <legend id='O3GM9'><style id='O3GM9'><dir id='O3GM9'><q id='O3GM9'></q></dir></style></legend>
                  本文介绍了类型不匹配:无法从整数转换为布尔值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  public boolean clearSelection() {
                      int i = 0;
                      if (!this.m_SelectedComps.isEmpty()) {
                          i = 1;
                          Iterator localIterator = this.m_SelectedComps.iterator();
                          while (localIterator.hasNext())
                              ((AnnotComponent) localIterator.next()).remove();
                          this.m_SelectedComps.clear();
                      }
                  
                      return i;
                  }
                  

                  如何将整数转换为布尔值?

                  How to convert the integer to boolean?

                  推荐答案

                  试试这个返回

                  return i == 1;
                  

                  或者只是使用布尔值开始(使用更好的名称):

                  or just use a boolean to start (with a better name):

                   public boolean clearSelection()
                    {
                      boolean flag = false;
                      if (!this.m_SelectedComps.isEmpty())
                      {
                        flag = true;
                        Iterator localIterator = this.m_SelectedComps.iterator();
                        while (localIterator.hasNext())
                          ((AnnotComponent)localIterator.next()).remove();
                        this.m_SelectedComps.clear();
                      }
                      return flag;
                    }
                  

                  它继续让我感到困惑为什么人们使用 i - 一个可怕的变量名.看起来像 1 并没有传达任何含义.

                  It continues to mystify me why people use i -- a horrible variable name. Looks like 1 and does not convey any meaning.

                  这篇关于类型不匹配:无法从整数转换为布尔值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:double a = a + int b 和 int a += double b 有什么区别? 下一篇:从 scala.collection.Seq&lt;String&gt; 转换到 java

                  相关文章

                  最新文章

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

                2. <small id='sTnJs'></small><noframes id='sTnJs'>

                3. <legend id='sTnJs'><style id='sTnJs'><dir id='sTnJs'><q id='sTnJs'></q></dir></style></legend>

                    <tfoot id='sTnJs'></tfoot>
                      <bdo id='sTnJs'></bdo><ul id='sTnJs'></ul>