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

    1. <legend id='njjNz'><style id='njjNz'><dir id='njjNz'><q id='njjNz'></q></dir></style></legend>

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

    2. <tfoot id='njjNz'></tfoot>

    3. <i id='njjNz'><tr id='njjNz'><dt id='njjNz'><q id='njjNz'><span id='njjNz'><b id='njjNz'><form id='njjNz'><ins id='njjNz'></ins><ul id='njjNz'></ul><sub id='njjNz'></sub></form><legend id='njjNz'></legend><bdo id='njjNz'><pre id='njjNz'><center id='njjNz'></center></pre></bdo></b><th id='njjNz'></th></span></q></dt></tr></i><div id='njjNz'><tfoot id='njjNz'></tfoot><dl id='njjNz'><fieldset id='njjNz'></fieldset></dl></div>
    4. 为什么我们不应该使用(默认)src 包?

      时间:2023-09-27
      <tfoot id='0AfIN'></tfoot>

        <small id='0AfIN'></small><noframes id='0AfIN'>

            <bdo id='0AfIN'></bdo><ul id='0AfIN'></ul>
              <tbody id='0AfIN'></tbody>
            <i id='0AfIN'><tr id='0AfIN'><dt id='0AfIN'><q id='0AfIN'><span id='0AfIN'><b id='0AfIN'><form id='0AfIN'><ins id='0AfIN'></ins><ul id='0AfIN'></ul><sub id='0AfIN'></sub></form><legend id='0AfIN'></legend><bdo id='0AfIN'><pre id='0AfIN'><center id='0AfIN'></center></pre></bdo></b><th id='0AfIN'></th></span></q></dt></tr></i><div id='0AfIN'><tfoot id='0AfIN'></tfoot><dl id='0AfIN'><fieldset id='0AfIN'></fieldset></dl></div>

              1. <legend id='0AfIN'><style id='0AfIN'><dir id='0AfIN'><q id='0AfIN'></q></dir></style></legend>
                本文介绍了为什么我们不应该使用(默认)src 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我最近开始使用 Eclipse IDE,并在许多地方阅读了不应使用默认 (src) 包并创建新包的地方.
                我只是想知道这背后的原因.

                I recently started using Eclipse IDE and have read at a number of places that one shouldn't use the default(src) package and create new packages.
                I just wanted to know the reason behind this.

                推荐答案

                使用默认包可能会造成命名空间冲突.假设您正在创建一个包含 MyClass 类的库.有人在他的项目中使用你的库,并且在他的默认包中也有一个 MyClass 类.编译器应该做什么?Java 中的包实际上是一个完全标识您的项目的名称空间.所以在现实世界的项目中不要使用默认包是很重要的.

                Using the default package may create namespace collisions. Imagine you're creating a library which contains a MyClass class. Someone uses your library in his project and also has a MyClass class in his default package. What should the compiler do? Package in Java is actually a namespace which fully identifies your project. So it's important to not use the default package in the real world projects.

                这篇关于为什么我们不应该使用(默认)src 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:在 java 中演示包名冲突 下一篇:这是 Java 包导入应该如何工作的吗?

                相关文章

                最新文章

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

              2. <tfoot id='iYYGe'></tfoot>

                <legend id='iYYGe'><style id='iYYGe'><dir id='iYYGe'><q id='iYYGe'></q></dir></style></legend>
                • <bdo id='iYYGe'></bdo><ul id='iYYGe'></ul>
              3. <i id='iYYGe'><tr id='iYYGe'><dt id='iYYGe'><q id='iYYGe'><span id='iYYGe'><b id='iYYGe'><form id='iYYGe'><ins id='iYYGe'></ins><ul id='iYYGe'></ul><sub id='iYYGe'></sub></form><legend id='iYYGe'></legend><bdo id='iYYGe'><pre id='iYYGe'><center id='iYYGe'></center></pre></bdo></b><th id='iYYGe'></th></span></q></dt></tr></i><div id='iYYGe'><tfoot id='iYYGe'></tfoot><dl id='iYYGe'><fieldset id='iYYGe'></fieldset></dl></div>