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

后端 未结 3 1440
旧巷少年郎
旧巷少年郎 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:54

    You are not passing command line arguments. args[0] is expecting a command line argument.

    IF you are running it from command line try this:

    java Intocm 12.0
    

    In eclipse

    Run---> Run Configuration--->
                                Arguments Tab--->
                                                give program arguments-->
                                                                      apply---> run
    

提交回复
热议问题