请解释 Java main ("public static void main(String[] args)") 的每个元素
please explain every element of Java main ("public static void main(String[] args)")
- 解释Java主要方法?
2.Why main 在 Java 中总是 public?
3.why main 总是静态的?
4.why main 总是接受字符串数组作为参数?
5.can 我们在 java?
中重载了 main 方法
- 我们可以覆盖 java 中的主要方法吗?
请详细说明
您好请在下面找到答案:
1.Explain Java 主要方法?
Please find complete explanation in following video : https://www.youtube.com/watch?v=Z7rPNwg-bfk&feature=youtu.be
2.Why main 在 Java?
中总是 public
So that main can be accessed by JVM.
3.why main is always static?
at RunTime JVM do not create any object and static method can be accessed by class name, so main is always static.
4.why main always accepts String array as argument?
it is a command line argument and any data type can be converted to string just by putting it in double quotes, so string is used.
5.can we overload main method in java?
Yes
6. can we override main method in java?
No Static methods can not be overridden.
- 解释Java主要方法? 2.Why main 在 Java 中总是 public? 3.why main 总是静态的? 4.why main 总是接受字符串数组作为参数? 5.can 我们在 java? 中重载了 main 方法
- 我们可以覆盖 java 中的主要方法吗?
请详细说明
您好请在下面找到答案: 1.Explain Java 主要方法?
Please find complete explanation in following video : https://www.youtube.com/watch?v=Z7rPNwg-bfk&feature=youtu.be
2.Why main 在 Java?
中总是 publicSo that main can be accessed by JVM. 3.why main is always static? at RunTime JVM do not create any object and static method can be accessed by class name, so main is always static. 4.why main always accepts String array as argument? it is a command line argument and any data type can be converted to string just by putting it in double quotes, so string is used. 5.can we overload main method in java? Yes 6. can we override main method in java? No Static methods can not be overridden.