Firstly, we use public, an access modifier that specifies that any variable or method can access the main() method. Then, we use the static keyword, which identifies the main() method as class-based. The main() can be accessed without instantiating the class. The compiler will throw an error if you do not declare the main() method static. main() is called by the JVM (Java Virtual Machine) before all the objects are made. The return type of the main() method in Java is void which means it doesn’t return a value, and args refer to the arguments passed to the main() method while we run the code.