0
does the class containing the main method need to be declared public? is it necessary to do so? also i would like to know if we can declare more than 1 class as public in a java file?
4 Respostas
+ 3
Yes, main needs to be public, and yes, you can declare more than one public method.
+ 1
no and yes
0
yes & yes
0
yes main should be in public class and we can have any number of classes as public