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

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

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

    1. <small id='TsAFp'></small><noframes id='TsAFp'>

    2. Eclipse/Java - 導入 java.(namespace).* 有害嗎?

      Eclipse/Java - is it harmful to import java.(namespace).*?(Eclipse/Java - 導入 java.(namespace).* 有害嗎?)

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

                  <tbody id='Sz9vg'></tbody>

                <tfoot id='Sz9vg'></tfoot>
              • <small id='Sz9vg'></small><noframes id='Sz9vg'>

                本文介紹了Eclipse/Java - 導入 java.(namespace).* 有害嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                為什么 Eclipse 在導入類型時采用細粒度的方法?在 C# 中,我習慣于使用 System.Windows.Controls"并完成它,但 Eclipse 更喜歡單獨導入我引用的每個小部件(使用 Ctrl+Shift+O 快捷方式).如果我知道我需要多個類型,那么導入整個命名空間有什么害處嗎?

                Why does Eclipse take a fine grained approach when importing types? In C# I'm used to things like "using System.Windows.Controls" and being done with it, but Eclipse prefers to import each widget I reference individually (using the Ctrl+Shift+O shortcut). Is there any harm to importing an entire namespace if I know I'll need multiple types in it?

                推薦答案

                通配符包導入可能造成的唯一危害是,如果多個包中存在多個同名類,則會增加命名空間沖突的機會.

                The only harm that wildcard package imports can cause is an increased chance of namespace collisions if there are multiple classes of the same name in multiple packages.

                例如,我想在 AWT 應(yīng)用程序中使用 Java Collections Framework 的 ArrayList 類進行編程,該應(yīng)用程序使用 List GUI 組件來顯示信息.舉個例子,假設(shè)我們有以下內(nèi)容:

                Say for example, I want to program to use the ArrayList class of the Java Collections Framework in an AWT application that uses a List GUI component to display information. For the sake of an example, let's suppose we have the following:

                // 'ArrayList' from java.util
                ArrayList<String> strings = new ArrayList<String>();
                
                // ...
                
                // 'List' from java.awt
                List listComponent = new List()
                

                現(xiàn)在,為了使用上述內(nèi)容,必須至少導入這兩個類:

                Now, in order to use the above, there would have to be an import for those two classes, minimally:

                import java.awt.List;
                import java.util.ArrayList;
                

                現(xiàn)在,如果我們在包 import 中使用通配符,我們會得到以下內(nèi)容.

                Now, if we were to use a wildcard in the package import, we'd have the following.

                import java.awt.*;
                import java.util.*;
                

                但是,現(xiàn)在我們有一個問題!

                However, now we will have a problem!

                有一個 java.awt.List 類和一個 java.util.List,所以引用 List 類會很模糊.如果我們想消除歧義,就必須使用完全限定的類名來引用 List:

                There is a java.awt.List class and a java.util.List, so referring to the List class would be ambiguous. One would have to refer to the List with a fully-qualified class name if we want to remove the ambiguity:

                import java.awt.*;
                import java.util.*;
                
                ArrayList<String> strings = new ArrayList<String>();
                
                // ...
                
                // 'List' from java.awt -- need to use a fully-qualified class name.
                java.awt.List listComponent = new java.awt.List()
                

                因此,在某些情況下,使用通配符包 import 可能會導致問題.

                Therefore, there are cases where using a wildcard package import can lead to problems.

                這篇關(guān)于Eclipse/Java - 導入 java.(namespace).* 有害嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數(shù)溢出?)
                Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關(guān)系嗎?)
                How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個隨機打亂數(shù)字的 int 數(shù)組)
                Inconsistent behavior on java#39;s ==(java的行為不一致==)
                Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲為 int?)

                <tfoot id='VGPDc'></tfoot>
                • <bdo id='VGPDc'></bdo><ul id='VGPDc'></ul>

                      <tbody id='VGPDc'></tbody>

                    1. <small id='VGPDc'></small><noframes id='VGPDc'>

                      • <legend id='VGPDc'><style id='VGPDc'><dir id='VGPDc'><q id='VGPDc'></q></dir></style></legend>
                        <i id='VGPDc'><tr id='VGPDc'><dt id='VGPDc'><q id='VGPDc'><span id='VGPDc'><b id='VGPDc'><form id='VGPDc'><ins id='VGPDc'></ins><ul id='VGPDc'></ul><sub id='VGPDc'></sub></form><legend id='VGPDc'></legend><bdo id='VGPDc'><pre id='VGPDc'><center id='VGPDc'></center></pre></bdo></b><th id='VGPDc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VGPDc'><tfoot id='VGPDc'></tfoot><dl id='VGPDc'><fieldset id='VGPDc'></fieldset></dl></div>
                          主站蜘蛛池模板: 亚洲第一区国产精品 | 91亚洲国产亚洲国产 | 亚洲国产欧美国产综合一区 | 超碰97免费观看 | 日韩欧美在线视频 | 日韩三极 | 欧美黄色小视频 | 翔田千里一区二区 | 亚洲成人一区二区三区 | 久久久精品网站 | 久久久久久久久99精品 | av黄色免费在线观看 | 精品中文在线 | 亚洲精品一区在线 | 一区二区三区四区在线视频 | 91精品久久久久久久 | 亚洲一区二区三区免费视频 | 超碰在线免费av | 91免费观看在线 | 国产一区二区三区久久久久久久久 | 欧美一区二区免费电影 | 欧美二区在线 | 亚洲视频在线看 | 成人免费视频网站 | 2一3sex性hd | 亚洲国产aⅴ成人精品无吗 欧美激情欧美激情在线五月 | 波多野结衣一二三区 | 四虎影院一区二区 | 国产成人精品一区二区三 | 99久久精品国产一区二区三区 | 国产免费看 | 免费久久99精品国产婷婷六月 | 成人国内精品久久久久一区 | 紧缚调教一区二区三区视频 | 国产剧情一区二区三区 | 久久精品视频网站 | 精品亚洲一区二区 | 欧美一区永久视频免费观看 | 午夜精品久久久久久久星辰影院 | 久久国产日韩欧美 | 久久这里只有 |