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

      1. <tfoot id='88lZB'></tfoot>

        为什么选择“010"?等于 8?

        时间:2023-09-29

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

              <tbody id='NpmeU'></tbody>
            <tfoot id='NpmeU'></tfoot>

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

                1. <legend id='NpmeU'><style id='NpmeU'><dir id='NpmeU'><q id='NpmeU'></q></dir></style></legend>
                2. 本文介绍了为什么选择“010"?等于 8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我的简单问题是为什么:

                  My simple question is why:

                  System.out.println(010|4);
                  

                  打印12"?我了解按位或运算符,但为什么010"等于 8?肯定不是恭维2的通知,那这个数字怎么解码呢?

                  prints "12"? I understand bitwise OR operator but why "010" equals 8? It's definitely not compliment 2's notification, so how to decode this number?

                  推荐答案

                  看看Java 语言规范,第 3.10.1 章整数文字

                  整数字面量可以用十进制(以 10 为底)、十六进制表示(以 16 为底)、八进制(以 8 为底) 或二进制(以 2 为底).

                  An integer literal may be expressed in decimal (base 10), hexadecimal (base 16), octal (base 8), or binary (base 2).

                  [...]

                  八进制数字由 ASCII 数字 0 后跟一个或多个ASCII 数字 0 到 7 之间穿插下划线,并且可以表示正整数、零整数或负整数.

                  An octal numeral consists of an ASCII digit 0 followed by one or more of the ASCII digits 0 through 7 interspersed with underscores, and can represent a positive, zero, or negative integer.

                  现在你应该明白为什么0108了.

                  Now you should understand why 010 is 8.

                  这篇关于为什么选择“010"?等于 8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:按列打印 Java 数组 下一篇:MissingFormatArgumentException 错误

                  相关文章

                  最新文章

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

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

                    1. <legend id='N1dSm'><style id='N1dSm'><dir id='N1dSm'><q id='N1dSm'></q></dir></style></legend>
                        <bdo id='N1dSm'></bdo><ul id='N1dSm'></ul>

                      <tfoot id='N1dSm'></tfoot>