久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

    2. <i id='Uxr5j'><tr id='Uxr5j'><dt id='Uxr5j'><q id='Uxr5j'><span id='Uxr5j'><b id='Uxr5j'><form id='Uxr5j'><ins id='Uxr5j'></ins><ul id='Uxr5j'></ul><sub id='Uxr5j'></sub></form><legend id='Uxr5j'></legend><bdo id='Uxr5j'><pre id='Uxr5j'><center id='Uxr5j'></center></pre></bdo></b><th id='Uxr5j'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Uxr5j'><tfoot id='Uxr5j'></tfoot><dl id='Uxr5j'><fieldset id='Uxr5j'></fieldset></dl></div>
      <tfoot id='Uxr5j'></tfoot>

      在 Java 中聲明一個 unsigned int

      Declaring an unsigned int in Java(在 Java 中聲明一個 unsigned int)
      <tfoot id='8TfsD'></tfoot>
        • <bdo id='8TfsD'></bdo><ul id='8TfsD'></ul>

          <small id='8TfsD'></small><noframes id='8TfsD'>

          <legend id='8TfsD'><style id='8TfsD'><dir id='8TfsD'><q id='8TfsD'></q></dir></style></legend>

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

              1. 本文介紹了在 Java 中聲明一個 unsigned int的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                有沒有辦法在 Java 中聲明一個 unsigned int?

                Is there a way to declare an unsigned int in Java?

                或者問題也可以這樣表述:無符號的 Java 等價物是什么?

                Or the question may be framed as this as well: What is the Java equivalent of unsigned?

                只是為了告訴你我正在查看 Java 的 String.hashcode() 實現的上下文.如果整數是 32 unsigned int,我想測試碰撞的可能性.

                Just to tell you the context I was looking at Java's implementation of String.hashcode(). I wanted to test the possibility of collision if the integer were 32 unsigned int.

                推薦答案

                Java 沒有 無符號整數.

                您可以定義一個 long 如果您需要存儲大值,而不是 int.

                您也可以像使用無符號整數一樣使用有符號整數.二的補碼表示的好處是大多數運算(例如加法、減法、乘法、和左移)在有符號和無符號整數的二進制級別上是相同的.然而,一些操作(除法、右移、比較和強制轉換)是不同的.從 Java SE 8 開始, 中的新方法Integer 類允許您充分使用 int 數據類型 執行無符號算術:

                You can also use a signed integer as if it were unsigned. The benefit of two's complement representation is that most operations (such as addition, subtraction, multiplication, and left shift) are identical on a binary level for signed and unsigned integers. A few operations (division, right shift, comparison, and casting), however, are different. As of Java SE 8, new methods in the Integer class allow you to fully use the int data type to perform unsigned arithmetic:

                在 Java SE 8 及更高版本中,可以使用 int 數據類型來表示一個無符號的 32 位整數,其最小值為 0,最大值為 2^32-1.使用 Integer 類將 int 數據類型用作無符號整數.靜態方法,例如 compareUnsigned, divideUnsigned 等已添加到 Integer 類中,以支持無符號整數的算術運算.

                In Java SE 8 and later, you can use the int data type to represent an unsigned 32-bit integer, which has a minimum value of 0 and a maximum value of 2^32-1. Use the Integer class to use int data type as an unsigned integer. Static methods like compareUnsigned, divideUnsigned etc have been added to the Integer class to support the arithmetic operations for unsigned integers.

                請注意,int 變量在聲明時仍然是有符號的,但現在可以通過使用 Integer 類中的這些方法來進行無符號運算.

                Note that int variables are still signed when declared but unsigned arithmetic is now possible by using those methods in the Integer class.

                這篇關于在 Java 中聲明一個 unsigned int的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                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?)

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

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

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

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

                        • 主站蜘蛛池模板: 亚洲日韩视频 | 国产成人精品久久二区二区91 | 性色av香蕉一区二区 | 久久久久久久久国产成人免费 | 男人的天堂亚洲 | 成人午夜视频在线观看 | 特一级毛片 | 欧洲高清转码区一二区 | 亚洲视频一区在线观看 | 国产综合视频 | 精品久久网 | 精久久久| 91精品国产色综合久久 | 国产欧美一区二区三区另类精品 | 国产精品不卡视频 | 国产日韩一区二区 | 久久i | 亚洲精品一区二区三区 | 国产91久久精品一区二区 | 精品在线看 | 伊人狼人影院 | 一级毛片,一级毛片 | 久草视频在线播放 | 国产成视频在线观看 | 伊人久久麻豆 | 亚洲视频在线看 | 午夜影院在线观看视频 | 狠狠干2020| 国产一级久久久久 | 蜜桃在线播放 | 狠狠操av | 美女视频h| 久久久久一区 | 又黑又粗又长的欧美一区 | 中文字幕日韩欧美一区二区三区 | 国产高清在线精品一区二区三区 | 人人看人人爽 | 超碰在线播 | 免费的色网站 | 成人网在线看 | 一区二区三区视频播放 |