title: Array index out of bounds when getting arguments
body: <p>Up until now I’ve managed to do various, simple things such as assigning to variables, calculations and what not, compiled it and all that good stuff…</p>
  
  <p>This section is about decisions using <code>if</code> and <code>else</code> statements. Here’s the code:</p>
  
  <pre><code>public class Decision 
  {
      public static void main(String[] args)
      {
          if (argv[0].equals("xyz"))
              System.out.println("Login successful");
          else 
              System.out.println("Login incorrect");  
      }
  }
  </code></pre>
  
  <p>So I compile the program in CMD and try to run it, but I get this:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at Decision.main(Decision.java:5)</p>
  </blockquote>
  
  <p>I understand there's a problem probably somewhere in the code but can't seem to find it- and I know once I have it will be blatantly obvious!</p>