title: NullPointerException When trying to get string element from array
body: <p>I have an array of strings called "CONSOLES" and a method "getConsoleName", when I try to get the name by index ID, i get a "NullPointerException"</p>
  
  <p>I just want to get the name by using index...</p>
  
  <p>for example:</p>
  
  <pre><code>   String myconsole = getConsoleName(0); // myConsole will be "PC"
  </code></pre>
  
  <hr>
  
  <p>this is my code:</p>
  
  <pre><code>   public static String[] CONSOLES = {
      "PC",
      "PS4",
      "XBOX ONE",
      "PS VITA"
  };
  
  public static String getConsoleName(int ID)
  {
      String rtext = "unknown";
      try {
          rtext = CONSOLES[ID];
      } catch (Exception e) {
          System.err.println(e);
      }
      return rtext;
  }
  </code></pre>
  
  <p>I hope you understood me</p>