title: Creating a charAt() method
body: <p>Part of my assignment is to create a <code>charAt()</code> method that will return the char value at the specified index. If the index if invalid, it will return the character at index zero.</p>
  
  <p>This is what I have so far, keep in mind that my assignment specifically states I cannot use existing string methods for Java.</p>
  
  <pre><code>public char charAt(int index) {
      char a;
      if (index &lt; 0 || index &gt; 25)
        a = list[0];
      else
        a = list[index];
      return a;
  }
  </code></pre>
  
  <p>I keep getting a <code>NullPointerException</code> error whenever I go to call the method <code>charAt</code>. Are there any corrections or pointers that you recommend? Or is the question too vague?</p>