title: Java: Check if command line arguments are null
body: <p>I am looking to do some error checking for my command line arguments</p>
  
  <pre><code>public static void main(String[] args)
  {
      if(args[0] == null)
      {
          System.out.println("Proper Usage is: java program filename");
          System.exit(0);
      }
  }
  </code></pre>
  
  <p>However, this returns an array out of bounds exception, which makes sense.  I am just looking for the proper usage.</p>