小编AK4*_*AK4的帖子

为什么main()在java中声明为public和static

为什么主要声明为公共和静态?

public static void main(String arg[])
{}
Run Code Online (Sandbox Code Playgroud)

根据java中的ans

"The method is static because otherwise there would be ambiguity: which constructor should be called?"
Run Code Online (Sandbox Code Playgroud)

java static program-entry-point public

6
推荐指数
1
解决办法
3万
查看次数

标签 统计

java ×1

program-entry-point ×1

public ×1

static ×1