久久久久久久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模板網!

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

                  相關文檔推薦

                  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>

                          • 主站蜘蛛池模板: 中文成人在线 | 亚洲一区二区网站 | 日韩精品久久 | 国产精品久久久久久久模特 | 一区二区精品 | 国产精品国产三级国产aⅴ中文 | 欧美综合一区二区三区 | 嫩草视频入口 | 日韩视频在线观看中文字幕 | 一区日韩 | 日本中文字幕日韩精品免费 | 一区二区日本 | 亚洲网站在线观看 | 欧美黄a | 天天综合网永久 | 日韩精品一区二区三区在线观看 | 东方伊人免费在线观看 | 国产日韩精品一区 | 欧美v日韩v | 日韩在线观看中文字幕 | 污视频在线免费观看 | 国产一区二区在线播放视频 | 久久一 | 日韩在线免费看 | 欧美在线一区二区视频 | 国产精品一区二区三区在线 | 国产精品免费福利 | 中文区中文字幕免费看 | 精品国产伦一区二区三区观看体验 | 国产美女自拍视频 | 91夜夜夜 | 国产成人精品在线播放 | 亚洲天堂免费 | 九九热这里只有精品6 | 男人天堂999| 伊人狼人影院 | 国产高清在线 | 日韩精品久久一区二区三区 | 狠狠操狠狠干 | 久久久久久久久久久一区二区 | 久久亚洲一区 |