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
If args[0] is causing an ArrayIndexOutOfBoundsException, then you didn't supply any command-line parameters. Test args.length; if it's 0, then handle the error.
args[0]
ArrayIndexOutOfBoundsException
args.length
0