Naming Conventions for Packages

You can use any identifier you wish to name your packages. However, we recommend you to follow these naming conventions when you create your packages.

  • Packages are usually named using the authors domain name. The domain name is written backwards to obtain the package name.

For example, imagine you own the domain example.com. You can create a package named com.example for all your packages.

Using your domain name allows you to create package names which are unique from the packages created by other programmers around the world.

  • Package names are usually written in lowercase letters. This helps you to avoid conflicts with class names.

  • You can add other subpackages to the package named after your domain. For example, you can create a program named Tesla and place all its source files under the com.example.tesla package. It can further contain other subpackages.