title: How do I make Double.parseDouble(args[0]); work?
body: <p>I want to write this little program which should make a simple calculation while taking input for one variable. Here's the code:</p>
  
  <pre><code>public class DFact {
      public static void main(String[] args) {
          int n;
          int df;
          int i;
  
          n = Integer.parseInt(args[0]);  
          df = 1;                 
          i = n;              
  
          while(i &gt; 0) {
              df = df * i;        
              i = i - 2;          
          }
  
          System.out.println(df); 
       }
  }
  </code></pre>
  
  <p>For this programm I am getting the following message: </p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0<br>
        at DFact.main(DFact.java:9)</p>
  </blockquote>