Why main method is marked as public?

前端 未结 9 1203
情书的邮戳
情书的邮戳 2020-12-10 08:41

I have a question that why main method is marked as public?

According to an answer on stackoverflow, It is declared as static

9条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 08:48

    The initialization software that starts your program must be able to see main so that it can call it.

提交回复
热议问题