title: How to check If the next element in an array is null - Java
body: <p>I'm creating quite a large, multiple class program and just need to find out if the next element in the array exists for one of my methods. (i.e.  if <code>i</code> is the last element).</p>
  
  <p>My code:</p>
  
  <pre><code>if (eMessageArray[i + 1] != null) {
      temp = stringShuffle(eMessageArray[i], eMessageArray[i + 1]);
      eMessageArray[i] = temp;
  } else if (eMessageArray[i + 1] == null) {
      temp = stringShuffle(eMessageArray[i], "NULL");
      eMessageArray[i] = temp;
  }
  </code></pre>