Java Module Naming Rules Guide

In Java, modules are named according to the following rules:

  1. The name of the Module must be a valid Java identifier, meaning it can only contain letters, numbers, underscores, and dollar signs, and cannot start with a number.
  2. Module names should be in lowercase letters, and underscores or hyphens can be used to separate words when needed.
  3. The name of the Module should be descriptive, clearly expressing the function or purpose of the module.
  4. The name of the module cannot be the same as Java’s reserved keywords.

For example, a module named “my_module” follows the naming convention, while names like “module-1” or “module$” do not comply with the rules.

bannerAds