While I was going through some tutorial one of the source code file had following to check if there were no command-line arguments :
if (null==args[0]) {
System.err.println("Properties file not specified at command line");
return;
}
Which for obvious reasons throws ArrayIndexOutOfBoundsException and doesn't print the message.
So,how to do this check and print the message without getting the exception being thrown?