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

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

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

        Java包名称中单词分隔符的约定是什么?

        时间:2023-09-27
        <legend id='9qBEo'><style id='9qBEo'><dir id='9qBEo'><q id='9qBEo'></q></dir></style></legend>
      1. <i id='9qBEo'><tr id='9qBEo'><dt id='9qBEo'><q id='9qBEo'><span id='9qBEo'><b id='9qBEo'><form id='9qBEo'><ins id='9qBEo'></ins><ul id='9qBEo'></ul><sub id='9qBEo'></sub></form><legend id='9qBEo'></legend><bdo id='9qBEo'><pre id='9qBEo'><center id='9qBEo'></center></pre></bdo></b><th id='9qBEo'></th></span></q></dt></tr></i><div id='9qBEo'><tfoot id='9qBEo'></tfoot><dl id='9qBEo'><fieldset id='9qBEo'></fieldset></dl></div>
        • <bdo id='9qBEo'></bdo><ul id='9qBEo'></ul>

              <tbody id='9qBEo'></tbody>
            1. <tfoot id='9qBEo'></tfoot>
              • <small id='9qBEo'></small><noframes id='9qBEo'>

                • 本文介绍了Java包名称中单词分隔符的约定是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  包名中的单词应该怎么分开?以下哪项是正确的?

                  How should one separate words in package names? Which of the following are correct?

                  1. com.stackoverflow.my_package(Snake Case 使用下划线)
                  2. com.stackoverflow.my-package(Kebab Case 使用连字符)
                  3. com.stackoverflow.myPackage(骆驼案例)
                  4. com.stackoverflow.MyPackage (Pascal Case)
                  1. com.stackoverflow.my_package (Snake Case using underscore)
                  2. com.stackoverflow.my-package (Kebab Case using hyphens)
                  3. com.stackoverflow.myPackage (Camel Case)
                  4. com.stackoverflow.MyPackage (Pascal Case)

                  一般标准是什么?

                  推荐答案

                  以下是官方命名约定文档的规定:

                  Here's what the official naming conventions document prescribes:

                  唯一包名的前缀总是用全小写的ASCII字母写的,应该是顶级域名之一,目前是comedugovmilnetorg 或用于标识国家/地区的英文双字母代码之一ISO 标准 3166,1981.

                  Packages

                  The prefix of a unique package name is always written in all-lowercase ASCII letters and should be one of the top-level domain names, currently com, edu, gov, mil, net, org, or one of the English two-letter codes identifying countries as specified in ISO Standard 3166, 1981.

                  软件包名称的后续组成部分根据组织自己的内部命名约定而有所不同.此类约定可能会指定某些目录名称组件是部门、部门、项目、机器或登录名.

                  Subsequent components of the package name vary according to an organization's own internal naming conventions. Such conventions might specify that certain directory name components be division, department, project, machine, or login names.

                  • com.sun.eng
                  • com.apple.quicktime.v2
                  • edu.cmu.cs.bovik.cheese

                  参考文献

                  • java.sun.com - 代码约定/命名
                  • 请注意,上述文档未指定顶级域前缀之后的任何内容.JLS 也同意这一点,举了以下例子:

                    Note that in particular, anything following the top-level domain prefix isn't specified by the above document. The JLS also agrees with this by giving the following examples:

                    • com.sun.sunsoft.DOE
                    • gov.whitehouse.socks.mousefinder
                    • com.JavaSoft.jag.Oak
                    • org.npr.pledge.driver
                    • uk.ac.city.rugby.game

                    以下摘录也是相关的:

                    在某些情况下,互联网域名可能不是有效的软件包名称.以下是处理这些情况的一些建议约定:

                    In some cases, the internet domain name may not be a valid package name. Here are some suggested conventions for dealing with these situations:

                    • 如果域名包含连字符或标识符中不允许的任何其他特殊字符,请将其转换为下划线.
                    • 如果任何生成的包名称组件是关键字,则在它们后面附加下划线.
                    • 如果任何生成的包名称组件以数字或任何其他不允许作为标识符的初始字符的字符开头,请在组件前加上下划线.

                    参考文献

                    • JLS 6.1 包名称
                    • 这篇关于Java包名称中单词分隔符的约定是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

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