DEV Community

Discussion on: Can the class containing `main` be private?

Collapse
 
baenencalin profile image
Calin Baenen

Ol, wb the class containing main inside it?

Collapse
 
cyberhck profile image
Nishchal Gautam

I'm not sure if I follow,
basically your java vm will simply call your class.main method, and when it finds that it's private or doesn't even exist, then it'll throw up

Thread Thread
 
baenencalin profile image
Calin Baenen

Ok. Thanks.