<legend id='CU0Nr'><style id='CU0Nr'><dir id='CU0Nr'><q id='CU0Nr'></q></dir></style></legend>
      <tfoot id='CU0Nr'></tfoot>

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

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

        没有域关联的 java 包名称的约定是什么?

        时间:2023-09-27
          <tbody id='L3vaE'></tbody>

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

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

            • <small id='L3vaE'></small><noframes id='L3vaE'>

            • <legend id='L3vaE'><style id='L3vaE'><dir id='L3vaE'><q id='L3vaE'></q></dir></style></legend>
                  本文介绍了没有域关联的 java 包名称的约定是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在 SO 上找不到回答我的确切问题的 Q/A,所以我想我会发布它,看看有什么结果.

                  就 Java 包的命名约定而言,我知道它应该是反向域名:com.whatever.stuff,并且我得到了关于不混合大小写、连字符、关键字等.

                  我还阅读了 Java 语言规范的第 7.7 节(唯一包名称).据我所知,Java 的规则是使用反向域来确保唯一性……如果你没有,那就去买一个:

                  您首先拥有(或属于拥有)互联网域名的组织,例如 sun.com,从而形成一个唯一的包名称. - 第 7.7 节

                  因此,如果我对花钱购买域名不感兴趣,我不属于我可以捎带名字的公司,我是否遗漏了命名约定的任何部分应该遵循吗?我想我可以随心所欲地为其命名,但我只是想知道我是否遗漏了什么.

                  注意:我想发布我的包供其他开发人员使用,所以我不想只做一些在我的系统上工作的东西,而是尽可能地做一些更标准的东西.p>

                  我添加了android标签是因为我要写的java包将用于Android应用程序,不知道android开发者是否有不同意见.

                  解决方案

                  如果你要分发很多东西,我真的建议你申请一个域名.然而,另一种选择是使用您的电子邮件:例如bob@gmail.com 将变为 com.gmail.bob.这比使用域名少见,但仍然由一些人完成,并且仍然确保唯一性.

                  I can't find a Q/A on SO that answers my exact question, so I figure I'd post it and see what comes back.

                  As far as the naming convention goes for Java packages, I understand that it's supposed to be the reverse domain name: com.whatever.stuff and I get the rules about no mixed case, hyphens, keywords, etc.

                  I've also read section 7.7 (Unique-Package-Names) of the Java Language Specification. As far as I can tell, the rules from Java are to use the reverse domain to insure uniqueness... and if you don't have one, go get one:

                  You form a unique package name by first having (or belonging to an organization that has) an Internet domainname, such as sun.com. - Section 7.7

                  So if I'm not interested in shelling out the money for a domain name, I don't belong to a company whose name I can piggyback off of, is there any part of the naming convention that I'm missing that should be followed? I'm thinking I can just go name it whatever unique name I feel like at this point, but I was just wondering if I was missing anything.

                  Note: I would like to release my package for other developers to use, so I didn’t want to just do something that worked on my system, but something more standard if possible.

                  I added the android tag because the java packages I'm going to be writing are going to be used in an Android application, wasn't sure if there were different opinions from android developers.

                  解决方案

                  If you are going to be distributing a lot of stuff, I would really suggest getting a domain name. Another alternative however would be to use your e-mail: e.g. bob@gmail.com would become com.gmail.bob. This is less common than using domain names but is still done by some and still ensures uniqueness.

                  这篇关于没有域关联的 java 包名称的约定是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:java包不存在且源文件错误 下一篇:为什么包名经常以“com"开头?

                  相关文章

                  最新文章

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

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