Java Error “Exception in thread ”main“ java.lang.ArrayIndexOutOfBoundsException”

后端 未结 3 1341
旧巷少年郎
旧巷少年郎 2021-01-26 05:59

Here is this simple code from my book it produces error message in netbeans and in compile version (.class) version running through Command prompt.

Error Message

3条回答
  •  无人及你
    2021-01-26 06:52

    The args parameter in a class's main method is supplied by command line arguments. You are not invoking the jar with any command line args, so the array has no zero element.

提交回复
热议问题