Why did Sololearn replaced public static void Main(){ } with static void Main(){ } | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Why did Sololearn replaced public static void Main(){ } with static void Main(){ }

Can you tell me their difference and why they did it

20th Jun 2020, 10:10 AM
Learn Big - LB
Learn Big - LB - avatar
2 Respostas
0
By default the template sets the method public, which is required by JVM by definition. Without the public modifier the method would be package private and due to that invisible for the JVM.
20th Jun 2020, 5:42 PM
Sandra Meyer
Sandra Meyer - avatar
0
I said c#
21st Jun 2020, 10:12 AM
Learn Big - LB
Learn Big - LB - avatar