When we would like to declare the class and modifiers it then we use nested or inner class . some rules are there :
- each source code file have a one public class only.
- file name and class name should be same .
- package should be first line in the source code if class is a part of package .
- import and package statements apply to all classes within a source code file.
Modifiers fall into two categories :
- Access modifiers: public, protected, private
- Non-access modifiers (including strictfp, final, and abstract.