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

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

          <bdo id='IOuMw'></bdo><ul id='IOuMw'></ul>
      1. <small id='IOuMw'></small><noframes id='IOuMw'>

        <tfoot id='IOuMw'></tfoot>
      2. <i id='IOuMw'><tr id='IOuMw'><dt id='IOuMw'><q id='IOuMw'><span id='IOuMw'><b id='IOuMw'><form id='IOuMw'><ins id='IOuMw'></ins><ul id='IOuMw'></ul><sub id='IOuMw'></sub></form><legend id='IOuMw'></legend><bdo id='IOuMw'><pre id='IOuMw'><center id='IOuMw'></center></pre></bdo></b><th id='IOuMw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IOuMw'><tfoot id='IOuMw'></tfoot><dl id='IOuMw'><fieldset id='IOuMw'></fieldset></dl></div>
      3. 如果 char 數組是 Java 中的 Object,為什么打印它不

        If a char array is an Object in Java, why does printing it not display its hash code?(如果 char 數組是 Java 中的 Object,為什么打印它不顯示其哈希碼?)
        <i id='ag8fu'><tr id='ag8fu'><dt id='ag8fu'><q id='ag8fu'><span id='ag8fu'><b id='ag8fu'><form id='ag8fu'><ins id='ag8fu'></ins><ul id='ag8fu'></ul><sub id='ag8fu'></sub></form><legend id='ag8fu'></legend><bdo id='ag8fu'><pre id='ag8fu'><center id='ag8fu'></center></pre></bdo></b><th id='ag8fu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ag8fu'><tfoot id='ag8fu'></tfoot><dl id='ag8fu'><fieldset id='ag8fu'></fieldset></dl></div>

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

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

            <tfoot id='ag8fu'></tfoot>

                  <tbody id='ag8fu'></tbody>
                • <bdo id='ag8fu'></bdo><ul id='ag8fu'></ul>
                  本文介紹了如果 char 數組是 Java 中的 Object,為什么打印它不顯示其哈希碼?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  打印 char 數組不顯示哈希碼:

                  Printing a char array does not display a hash code:

                  class IntChararrayTest{
                      public static void main(String[] args){
                          int intArray[] = {0,1,2};
                          char charArray[] = {'a','b','c'};
                          System.out.println(intArray);
                          System.out.println(charArray);
                      }
                  }
                  

                  輸出:

                  [I@19e0bfd
                  abc
                  

                  為什么整數數組打印為哈希碼而不是字符數組?

                  Why is the integer array printed as a hashcode and not the char array?

                  推薦答案

                  首先,char 數組是 Java 中的 Object,就像任何其他類型的數組一樣.只是打印方式不同.

                  First of all, a char array is an Object in Java just like any other type of array. It is just printed differently.

                  PrintStream(它是 System.out 實例的類型)有一個特殊版本的 println 用于字符數組 - public void println(char x[]) - 所以它不必為該數組調用 toString.最終調用public void write(char cbuf[], int off, int len),將數組的字符寫入輸出流.

                  PrintStream (which is the type of the System.out instance) has a special version of println for character arrays - public void println(char x[]) - so it doesn't have to call toString for that array. It eventually calls public void write(char cbuf[], int off, int len), which writes the characters of the array to the output stream.

                  這就是為什么為 char[] 調用 println 的行為不同于為其他類型的數組調用它的原因.對于其他數組類型,選擇 public void println(Object x) 重載,它調用 String.valueOf(x),它調用 x.toString(),它為 int 數組返回類似 [I@19e0bfd 的內容.

                  That's why calling println for a char[] behaves differently than calling it for other types of arrays. For other array types, the public void println(Object x) overload is chosen, which calls String.valueOf(x), which calls x.toString(), which returns something like [I@19e0bfd for int arrays.

                  這篇關于如果 char 數組是 Java 中的 Object,為什么打印它不顯示其哈希碼?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯誤)
                  Java Switch Statement - Is quot;orquot;/quot;andquot; possible?(Java Switch 語句 - 是“或/“和可能的?)
                  Java Replace Character At Specific Position Of String?(Java替換字符串特定位置的字符?)
                  What is the type of a ternary expression with int and char operands?(具有 int 和 char 操作數的三元表達式的類型是什么?)
                  Read a text file and store every single character occurrence(讀取文本文件并存儲出現的每個字符)
                  Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉換 char 原語?)

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

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

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

                            <i id='WqxfR'><tr id='WqxfR'><dt id='WqxfR'><q id='WqxfR'><span id='WqxfR'><b id='WqxfR'><form id='WqxfR'><ins id='WqxfR'></ins><ul id='WqxfR'></ul><sub id='WqxfR'></sub></form><legend id='WqxfR'></legend><bdo id='WqxfR'><pre id='WqxfR'><center id='WqxfR'></center></pre></bdo></b><th id='WqxfR'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WqxfR'><tfoot id='WqxfR'></tfoot><dl id='WqxfR'><fieldset id='WqxfR'></fieldset></dl></div>
                            <legend id='WqxfR'><style id='WqxfR'><dir id='WqxfR'><q id='WqxfR'></q></dir></style></legend>
                          1. 主站蜘蛛池模板: 欧美性猛交一区二区三区精品 | 美女黄视频网站 | 欧美一级欧美三级在线观看 | 久久大陆 | 成人h动漫亚洲一区二区 | 黄色免费网站在线看 | 国产精品欧美一区二区三区不卡 | 精品久久久久久 | 久草网址 | 中文一区二区 | 亚洲一区二区三区在线 | 欧美理论片在线观看 | 欧美激情精品久久久久久变态 | 91久久综合亚洲鲁鲁五月天 | 天天躁天天操 | 日韩精品一区二区三区在线播放 | 91九色在线观看 | 毛片a级毛片免费播放100 | 国产高清在线精品 | 蜜桃av鲁一鲁一鲁一鲁 | 成人一区精品 | 亚洲欧美另类在线 | 午夜噜噜噜 | 成人国产综合 | 日韩一区二区在线播放 | 精品视频在线观看 | 国产成人99久久亚洲综合精品 | 国产精品视频在线免费观看 | 在线一区视频 | 欧美日韩国产综合在线 | 中文字幕 国产 | 国产精品久久久久一区二区三区 | 欧美a∨ | 亚洲欧美日韩中文字幕一区二区三区 | 精品欧美乱码久久久久久 | 亚洲欧洲精品一区 | 欧美区在线| 欧美成人自拍 | 亚洲免费成人av | 成人在线精品 | 国产日韩欧美另类 |