title: How to fix a dead code warning in a boolean method? (i++)
body: <p>I'm working on a hangman game, and this boolean statement will not run due to an i++ being dead code. Here's the affected piece of code.</p>
  
  <p>Code:</p>
  
  <pre><code>import java.util.*;
  
  public class Hangman { 
  
  Scanner keyboard = new Scanner(System.in);
  Random rand = new Random();
  char[] word;
  char[] userInputs;
  int lengthofWord;
  
  boolean isIn(char c, char[] word) {
      lengthofWord = word.length;
      for(int i = 0; i &lt; lengthofWord; i++) {
          if(word[i] == c) {
              return false;
          }
          else
              return true;
      }
  }
  </code></pre>