main method
The method where a Java program starts running.
The main method is the entry point the java launcher calls; in Java 25 it can be written as void main() as well as the traditional public static void main(String[] args).
Examples
void main() { ... }in a compact source file, orpublic static void main(String[] args)in a classic class.
See also