Static Members in Java | Java Tutorials
This Java Tutorials “Static Members in Java” post giving introduction to static members in java application with diagrammatic explanation.
- Common functionality of Java application must be defined as static.
- Static members we can access directly by using class name.
- Java supports 4 static members.
- Static main method
- Static block
- Static user method
- Static variable
- In java we can save java source file with any name.
- We need to compile the program with source file name.
- After compilation, class file will be generated with the defined class name.
// empty ….
- Compiler takes care of syntactical errors only.
- Compiler never checks main method is present or not.
- JVM invokes main method to start application execution.