What are the rules for defining class names in Java?
In Java, class names must adhere to the following rules:
- Class names must start with a letter, underscore, or dollar sign.
- Class names can consist of letters, numbers, underscores, or dollar signs.
- Class names cannot contain spaces.
- The class name cannot be a keyword in Java.
- Class names are case-sensitive, meaning that Hello and hello are two different class names.
- Class names should be in camel case, with the first letter lowercase and the first letter of each subsequent word capitalized, for example: myClassName.
- Class names should be descriptive and clearly express the functionality or purpose of the class.