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

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

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

        <bdo id='k9JAo'></bdo><ul id='k9JAo'></ul>
      <legend id='k9JAo'><style id='k9JAo'><dir id='k9JAo'><q id='k9JAo'></q></dir></style></legend>
      <tfoot id='k9JAo'></tfoot>

        為什么不能分配 I &lt;?擴展類型>到&lt;類

        Why can#39;t assign I lt;? extends Typegt; to lt;Typegt;?(為什么不能分配 I lt;?擴展類型到lt;類型gt;?)

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

          <tbody id='pqwF4'></tbody>
        <tfoot id='pqwF4'></tfoot>
          • <bdo id='pqwF4'></bdo><ul id='pqwF4'></ul>

                <legend id='pqwF4'><style id='pqwF4'><dir id='pqwF4'><q id='pqwF4'></q></dir></style></legend>

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

                  本文介紹了為什么不能分配 I &lt;?擴展類型>到&lt;類型&gt;?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  以下陳述:

                  URLClassLoader ucl = (URLClassLoader) ClassLoader.getSystemClassLoader();
                  Class<URLClassLoader> uclc = ucl.getClass();
                  

                  因錯誤而失敗:

                  Type mismatch: cannot convert from Class<capture#2-of ? extends URLClassLoader> to Class<URLClassLoader>
                  

                  這里為什么需要演員表?

                  Why do I need a cast, here?

                  我發現了幾篇文章解釋了為什么你不能做相反的事情(將 T 分配給 a ),但這(有點)顯而易見并且可以理解.

                  I found several posts explaining why You can't do the reverse (assign T to a ), but that's (kind of) obvious and understood.

                  注意:我是在 eclipse Luna 下編寫的,所以我不知道這是 Luna 的怪癖還是我真的不理解泛型.

                  NOTE: I am coding this under eclipse Luna, so I don't know if it's a Luna Quirk or if there's something I really dont understand in generics.

                  推薦答案

                  協變 vs 逆變 vs 不變

                  • 不變的.

                  因此,

                  不是 Class<URLClassLoader>

                  在 Java 中,變量可以保存對相同類型或子類型的實例的引用.

                  In Java a variable can hold a reference of an instance of same type or subtype.

                  因此,

                  Class<URLClassLoader> uclc = ucl.getClass();
                  

                  無效.

                  另一方面,

                  Class<? extends URLClassLoader> uclc = ucl.getClass();
                  

                  將是有效.

                  這篇關于為什么不能分配 I &lt;?擴展類型>到&lt;類型&gt;?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 原語?)
                  <i id='Sqw3I'><tr id='Sqw3I'><dt id='Sqw3I'><q id='Sqw3I'><span id='Sqw3I'><b id='Sqw3I'><form id='Sqw3I'><ins id='Sqw3I'></ins><ul id='Sqw3I'></ul><sub id='Sqw3I'></sub></form><legend id='Sqw3I'></legend><bdo id='Sqw3I'><pre id='Sqw3I'><center id='Sqw3I'></center></pre></bdo></b><th id='Sqw3I'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Sqw3I'><tfoot id='Sqw3I'></tfoot><dl id='Sqw3I'><fieldset id='Sqw3I'></fieldset></dl></div>
                  • <small id='Sqw3I'></small><noframes id='Sqw3I'>

                        <tbody id='Sqw3I'></tbody>
                      <tfoot id='Sqw3I'></tfoot>
                      <legend id='Sqw3I'><style id='Sqw3I'><dir id='Sqw3I'><q id='Sqw3I'></q></dir></style></legend>
                        <bdo id='Sqw3I'></bdo><ul id='Sqw3I'></ul>

                            主站蜘蛛池模板: 99re视频在线 | 日韩在线一区视频 | 超碰av人人 | 色精品| 国产精品99久久久久久久vr | 中文字幕在线国产 | 久久99精品久久久久久国产越南 | 国产免费一区二区三区免费视频 | 日韩欧美一级 | 日韩在线小视频 | 2019天天操 | 久久国产精品色av免费观看 | 亚洲一区二区三区在线免费观看 | 欧美一级在线观看 | 亚洲一区二区三区免费视频 | 永久精品| 欧美久久久久久 | 欧美性受xxx | 99re视频在线| 欧美色综合天天久久综合精品 | 美女视频网站久久 | 国产精品成人免费 | 色婷婷久久综合 | 青青草一区 | 一区二区在线不卡 | 91正在播放 | 亚洲成人国产 | 激情六月丁香婷婷 | 精品一区二区在线视频 | av在线免费观看网址 | 色婷婷九月 | 黄色骚片| 成在线人视频免费视频 | 亚洲精选久久 | 欧美激情五月 | 久久久久国产精品一区二区 | 欧美成人免费在线视频 | 精品一区二区三区免费毛片 | 亚洲免费一区 | 亚洲小视频在线观看 | 91影院在线观看 |