Identifier
The identifier can start with a letter, underscore, or currency symbol.
After the first character, the identifier can also contain numbers
The identifier can be of any length
You must use the camelcase rule to name the javebeans method. The method must start with set, get, is, add, and remove.
Declaration Rules
A source code file can only have one public class
If the source file contains a public class, the file name should be the same as the public class name.
A file can have only one package statement, but multiple import statements
The package Statement (if any) must be in the first line of the source file
The Import Statement (if any) must be placed after the package statement and before the class declaration
If no package statement exists, the import statement must be the first statement in the source file.
The package and Import Statement are applied to all classes of the file.
Classes without public files have no naming restrictions
Class access modifier
There are three access modifiers: Public protected private
There are four access levels: public, protected, default, and private
Class can only have one public or default access
Classes with default access are only visible to classes in the same package
Classes with public access are visible to all classes in all packages.
Class Modifier
Class can also be modified to final, abstract, strictfp
Classes cannot be both final and abstract.
The final class cannot be any more molecular class
Abstract classes cannot be instantiated.
An abstract method in a class means that the entire class must be abstract.
Abstract classes can have abstract and non-abstract methods.
The first concrete class of the extended abstract class must implement all its abstract methods.