Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here's what the official naming conventions document prescribes:</p> <blockquote> <h3>Packages</h3> <p>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 <code>com</code>, <code>edu</code>, <code>gov</code>, <code>mil</code>, <code>net</code>, <code>org</code>, or one of the English two-letter codes identifying countries as specified in ISO Standard 3166, 1981.</p> <p>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.</p> <h3>Examples</h3> <ul> <li><code>com.sun.eng</code></li> <li><code>com.apple.quicktime.v2</code></li> <li><code>edu.cmu.cs.bovik.cheese</code></li> </ul> </blockquote> <h3>References</h3> <ul> <li><a href="http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html" rel="noreferrer">java.sun.com - Code Conventions/Naming</a></li> </ul> <hr> <p>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:</p> <blockquote> <ul> <li><code>com.sun.sunsoft.DOE</code></li> <li><code>gov.whitehouse.socks.mousefinder</code></li> <li><code>com.JavaSoft.jag.Oak</code></li> <li><code>org.npr.pledge.driver</code></li> <li><code>uk.ac.city.rugby.game</code></li> </ul> </blockquote> <p>The following excerpt is also relevant:</p> <blockquote> <p>In some cases, the internet domain name may not be a valid package name. Here are some suggested conventions for dealing with these situations:</p> <ul> <li>If the domain name contains a hyphen, or any other special character not allowed in an identifier, convert it into an underscore.</li> <li>If any of the resulting package name components are keywords then append underscore to them.</li> <li>If any of the resulting package name components start with a digit, or any other character that is not allowed as an initial character of an identifier, have an underscore prefixed to the component. </li> </ul> </blockquote> <h3>References</h3> <ul> <li><a href="http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.8.1" rel="noreferrer">JLS 6.8.1 Package Names</a></li> <li><a href="http://java.sun.com/docs/books/jls/third_edition/html/packages.html#7.7" rel="noreferrer">JLS 7.7 Unique Package Names</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload