摘要:
一个暂且说的过去的解释 The method is static because otherwise there would be ambiguity: which constructor should be called? Especially if your class looks like this:1 public class JavaClass{2 protected JavaClass(int x){}3 public void main(String[] args){4 }5 } Should the JVM call new JavaCla... 阅读全文
摘要:
1 package test; 2 3 public class Test { 4 5 public static void main(String[] args) { 6 7 final int num2 = Integer.parseInt(args[0]); 8 9 }10 11 }编译时,会报Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at test.Test.main(Test.java:7)最终的结论是: 运行时忘了加运行时参数了。运行时没有输... 阅读全文