<legend id='NBS7a'><style id='NBS7a'><dir id='NBS7a'><q id='NBS7a'></q></dir></style></legend>
  • <tfoot id='NBS7a'></tfoot>

    1. <small id='NBS7a'></small><noframes id='NBS7a'>

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

        在Java中将布尔值转换为int

        Convert boolean to int in Java(在Java中将布尔值转换为int)

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

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

          1. <legend id='uUIhD'><style id='uUIhD'><dir id='uUIhD'><q id='uUIhD'></q></dir></style></legend>

            • <tfoot id='uUIhD'></tfoot>
                <tbody id='uUIhD'></tbody>

                  <bdo id='uUIhD'></bdo><ul id='uUIhD'></ul>

                • 本文介绍了在Java中将布尔值转换为int的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 Java 中将 boolean 转换为 int 最常用的方法是什么?

                  What is the most accepted way to convert a boolean to an int in Java?

                  推荐答案

                  int myInt = myBoolean ? 1 : 0;
                  

                  ^^

                  PS:真 = 1 假 = 0

                  PS : true = 1 and false = 0

                  这篇关于在Java中将布尔值转换为int的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
                  Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
                  How to convert Integer to int?(如何将整数转换为整数?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
                  Inconsistent behavior on java#39;s ==(java的行为不一致==)
                  Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)
                    <tbody id='0ntrb'></tbody>

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

                    • <tfoot id='0ntrb'></tfoot>
                        <bdo id='0ntrb'></bdo><ul id='0ntrb'></ul>

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