title: Get the command line arguments in NetBeans 7.1.2
body: <p>I am using NetBeans 7.1.2. My error is:</p>
  
  <pre><code>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
  at javaapplication1.JavaApplication1.main(JavaApplication1.java:17)
  Java Result: 1
  </code></pre>
  
  <p>My program is:</p>
  
  <pre><code>package javaapplication1;
  
  /**
   *
   * @author Administrator
   */
  public class JavaApplication1 {
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] ar) {
          int a=Integer.parseInt(ar[1]);
  
          System.out.println(a);
          // TODO: Code application logic here
      }
  }
  </code></pre>