DEV Community

loading...

Discussion on: Can `main` be `protected` (and be the program entry point) in Java?

Collapse
habereder profile image
Raphael Habereder • Edited

To quote Oracle:

The method main must be declared public, static, and void. 
It must specify a formal parameter whose declared type is array of String. 
Enter fullscreen mode Exit fullscreen mode

Which can be found in the official Java Language Specification