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

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

      <small id='2iIwW'></small><noframes id='2iIwW'>

          <bdo id='2iIwW'></bdo><ul id='2iIwW'></ul>

        如何在 Java 中將 int 轉換為 Long?

        How do I convert from int to Long in Java?(如何在 Java 中將 int 轉換為 Long?)
          <bdo id='XZYcu'></bdo><ul id='XZYcu'></ul>

            <tbody id='XZYcu'></tbody>
          1. <small id='XZYcu'></small><noframes id='XZYcu'>

          2. <legend id='XZYcu'><style id='XZYcu'><dir id='XZYcu'><q id='XZYcu'></q></dir></style></legend>

            <tfoot id='XZYcu'></tfoot>

                <i id='XZYcu'><tr id='XZYcu'><dt id='XZYcu'><q id='XZYcu'><span id='XZYcu'><b id='XZYcu'><form id='XZYcu'><ins id='XZYcu'></ins><ul id='XZYcu'></ul><sub id='XZYcu'></sub></form><legend id='XZYcu'></legend><bdo id='XZYcu'><pre id='XZYcu'><center id='XZYcu'></center></pre></bdo></b><th id='XZYcu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='XZYcu'><tfoot id='XZYcu'></tfoot><dl id='XZYcu'><fieldset id='XZYcu'></fieldset></dl></div>
                  本文介紹了如何在 Java 中將 int 轉換為 Long?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我一直在這里和谷歌上發現從 longint 而不是相反的問題.但我確信在從 intLong 之前遇到這種情況的人不止我一個.

                  I keep finding both on here and Google people having troubles going from long to int and not the other way around. Yet I'm sure I'm not the only one that has run into this scenario before going from int to Long.

                  我發現的唯一其他答案是首先將其設置為 Long",這確實沒有解決問題.

                  The only other answers I've found were "Just set it as Long in the first place" which really doesn't address the question.

                  我最初嘗試強制轉換,但得到Cannot cast from int to Long"

                  I initially tried casting but I get a "Cannot cast from int to Long"

                  for (int i = 0; i < myArrayList.size(); ++i ) {
                      content = new Content();
                      content.setDescription(myArrayList.get(i));
                      content.setSequence((Long) i);
                      session.save(content);
                  }
                  

                  你可以想象我有點困惑,我被困在使用 int 因為一些內容是作為一個 ArrayList 和我的實體進入的m 存儲此信息需要序列號為 Long.

                  As you can imagine I'm a little perplexed, I'm stuck using int since some content is coming in as an ArrayList and the entity for which I'm storing this info requires the sequence number as a Long.

                  推薦答案

                  請注意,轉換為 long 和轉換為 Long 之間存在差異.如果你轉換成 long (一個原始值),那么它應該被自動裝箱成一個 Long (包裝它的引用類型).

                  Note that there is a difference between a cast to long and a cast to Long. If you cast to long (a primitive value) then it should be automatically boxed to a Long (the reference type that wraps it).

                  您也可以使用 new 創建 Long 的實例,并使用 int 值對其進行初始化.

                  You could alternatively use new to create an instance of Long, initializing it with the int value.

                  這篇關于如何在 Java 中將 int 轉換為 Long?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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?)

                        <tbody id='nH5eG'></tbody>

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

                      1. <tfoot id='nH5eG'></tfoot>

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

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

                            主站蜘蛛池模板: 国产三级电影网站 | 国产精品国产a级 | 午夜av成人| 欧美一区二区三区国产 | 精品二区 | 在线一区二区国产 | 91porn国产成人福利 | 久久成人一区 | www.成人.com | 天天影视综合 | 日日天天 | 日韩精品一区二区三区 | 日韩视频一区二区在线 | h视频在线观看免费 | 日本精品视频在线 | 久久久久久久久精 | 日韩福利 | 久久高清 | 精品国产精品三级精品av网址 | 金莲网| 天天插天天操 | 国产欧美在线一区二区 | 日韩视频区 | 欧美看片 | 久久久久av | av片免费 | 国产精品三级久久久久久电影 | 久久精品这里精品 | 欧美精品网 | 午夜看片网站 | 在线看黄免费 | www国产亚洲精品 | 国内精品视频免费观看 | 色婷婷在线视频 | 亚洲欧美激情网 | 一区二区av| 欧美成人精品一区二区男人看 | 日韩不卡在线观看 | 新超碰97 | 日本精品在线观看 | 大久 |