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

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

  • <tfoot id='6lYzH'></tfoot>
  • <legend id='6lYzH'><style id='6lYzH'><dir id='6lYzH'><q id='6lYzH'></q></dir></style></legend>
      <bdo id='6lYzH'></bdo><ul id='6lYzH'></ul>

      1. <small id='6lYzH'></small><noframes id='6lYzH'>

        “int 不能被取消引用";在爪哇

        quot;int cannot be dereferencedquot; in Java(“int 不能被取消引用;在爪哇)
        • <bdo id='9wgTh'></bdo><ul id='9wgTh'></ul>
          <i id='9wgTh'><tr id='9wgTh'><dt id='9wgTh'><q id='9wgTh'><span id='9wgTh'><b id='9wgTh'><form id='9wgTh'><ins id='9wgTh'></ins><ul id='9wgTh'></ul><sub id='9wgTh'></sub></form><legend id='9wgTh'></legend><bdo id='9wgTh'><pre id='9wgTh'><center id='9wgTh'></center></pre></bdo></b><th id='9wgTh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9wgTh'><tfoot id='9wgTh'></tfoot><dl id='9wgTh'><fieldset id='9wgTh'></fieldset></dl></div>
          <legend id='9wgTh'><style id='9wgTh'><dir id='9wgTh'><q id='9wgTh'></q></dir></style></legend>

          • <tfoot id='9wgTh'></tfoot>

              <tbody id='9wgTh'></tbody>

              <small id='9wgTh'></small><noframes id='9wgTh'>

                  本文介紹了“int 不能被取消引用";在爪哇的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我對 Java 還很陌生,我正在使用 BlueJ.我在嘗試編譯時不斷收到這個Int cannot be dereferenced"錯誤,我不確定問題是什么.該錯誤特別發(fā)生在我底部的 if 語句中,它說等于"是一個錯誤,int 不能被取消引用".希望得到一些幫助,因為我不知道該怎么做.提前謝謝!

                  I'm fairly new to Java and I'm using BlueJ. I keep getting this "Int cannot be dereferenced" error when trying to compile and I'm not sure what the problem is. The error is specifically happening in my if statement at the bottom, where it says "equals" is an error and "int cannot be dereferenced." Hope to get some assistance as I have no idea what to do. Thank you in advance!

                  public class Catalog {
                      private Item[] list;
                      private int size;
                  
                      // Construct an empty catalog with the specified capacity.
                      public Catalog(int max) {
                          list = new Item[max];
                          size = 0;
                      }
                  
                      // Insert a new item into the catalog.
                      // Throw a CatalogFull exception if the catalog is full.
                      public void insert(Item obj) throws CatalogFull {
                          if (list.length == size) {
                              throw new CatalogFull();
                          }
                          list[size] = obj;
                          ++size;
                      }
                  
                      // Search the catalog for the item whose item number
                      // is the parameter id.  Return the matching object 
                      // if the search succeeds.  Throw an ItemNotFound
                      // exception if the search fails.
                      public Item find(int id) throws ItemNotFound {
                          for (int pos = 0; pos < size; ++pos){
                              if (id.equals(list[pos].getItemNumber())){ //Getting error on "equals"
                                  return list[pos];
                              }
                              else {
                                  throw new ItemNotFound();
                              }
                          }
                      }
                  }
                  

                  推薦答案

                  id 是原始類型 int 而不是 Object.您不能像在此處那樣調用原語上的方法:

                  id is of primitive type int and not an Object. You cannot call methods on a primitive as you are doing here :

                  id.equals
                  

                  嘗試替換這個:

                          if (id.equals(list[pos].getItemNumber())){ //Getting error on "equals"
                  

                          if (id == list[pos].getItemNumber()){ //Getting error on "equals"
                  

                  這篇關于“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(如何在給定范圍內創(chuàng)建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                  1. <legend id='wsb41'><style id='wsb41'><dir id='wsb41'><q id='wsb41'></q></dir></style></legend>
                    <i id='wsb41'><tr id='wsb41'><dt id='wsb41'><q id='wsb41'><span id='wsb41'><b id='wsb41'><form id='wsb41'><ins id='wsb41'></ins><ul id='wsb41'></ul><sub id='wsb41'></sub></form><legend id='wsb41'></legend><bdo id='wsb41'><pre id='wsb41'><center id='wsb41'></center></pre></bdo></b><th id='wsb41'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wsb41'><tfoot id='wsb41'></tfoot><dl id='wsb41'><fieldset id='wsb41'></fieldset></dl></div>

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

                    <tfoot id='wsb41'></tfoot>

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

                            <tbody id='wsb41'></tbody>

                          • 主站蜘蛛池模板: 日韩成人免费视频 | 黄色av观看 | www.久久| 久久久久国产一区二区三区四区 | 国产欧美日韩视频 | 国产综合久久久 | 久久99精品久久久久久国产越南 | 久久成人精品一区二区三区 | 在线观看深夜视频 | 精品欧美一区二区久久久伦 | 国产精品久久国产精品久久 | 亚洲精品乱码久久久久久蜜桃91 | 亚洲天堂av网 | 麻豆视频在线免费观看 | 91精品欧美久久久久久久 | 日本在线小视频 | 自拍偷拍小视频 | 狠狠入ady亚洲精品经典电影 | www.色婷婷 | 在线中文视频 | 亚洲一区二区三区在线免费 | 久久国产精品久久久久久 | 国产在线观看 | 日韩中文字幕高清 | 国产一区二区精品在线 | 日韩免费在线视频 | 黄色在线免费看 | 国产中文 | 黄色网一级片 | 亚洲精品字幕 | 国产亚洲一区二区三区 | 91不卡 | 91视频一区二区三区 | 91精品国产综合久久久久久丝袜 | 亚洲欧美日韩久久久 | 欧美成人免费电影 | 成人天堂噜噜噜 | 精品一区二区三区四区五区 | 成人免费一区二区三区视频网站 | 99热国产免费| 国产1区在线 |