+ 1
Is SoloLearn wrong???
So is c#'s main method "static void Main (){}" or "static PUBLIC void Main (){}" Edit: jw because a compiler i have on my phone rejects the main method unless its public
1 Answer
+ 4
Main method can be both public or private, it is private by default, because it is the entrypoint of a program and therefore no other method needs to call it. But you can make it public if you want it to be called from another program, for example if you are creating some API!
Remember that if no access modifier is specified it is private by default, so:
static void Main(string[] args) it is private!