Why is the Java main method static?

前端 未结 30 2158
离开以前
离开以前 2020-11-22 01:41

The method signature of a Java main() method is:

public static void main(String[] args){
    ...
}

Is the

30条回答
  •  感情败类
    2020-11-22 02:04

    Before the main method is called, no objects are instantiated. Having the static keyword means the method can be called without creating any objects first.

提交回复
热议问题