📜  为什么 main 方法是静态的 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:48.392000             🧑  作者: Mango

代码示例1
Because the object is not required to call the static method. 
If we make the main method non-static, 
JVM will have to create its object first and then call main() method which 
will lead to the extra memory allocation.