
When you learn Java,Some details of the small problems tend to be very confusing,When in receive parameters, for example。
If your program needs to receive arguments in order to run,And you did not give the default parameters,That can cause this error:
1 |
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 |
For example, your code is:
1 2 3 |
public static void main (String[] args) { new SomeClass(args[0]); } |
When you need to run the program at this point passed in the parameter。It's not difficult,The hard part is in ecl[……]