title: Java Hangman code, char array
body: <p>If any of you can point out the issue in this code, i'll be glad :)
  This is just the method im having issue with.. </p>
  
  <pre><code>public static char[] checkMethod(char[] checkArray, char letter)
  {
      boolean flag = false;
  
      for(int i=0; i&lt;checkArray.length; i++)
      {
  
          if(checkArray[i] == letter)
          {
              checkArray[i] = letter;
              flag = true;
          }
      }
  
      if(flag == true)
          System.out.println("Good job!");
      else 
          System.out.println("Aww.. Try again");
  
      return checkArray;
  }
  </code></pre>
  
  <p>Currently the checkArray contains " - - - - -" for the length of the word. This method is supposed to replace the _ with the letter, if entered correctly. 'letter' is the input given from keyboard.</p>
  
  <p>Right now i'm not getting the expected output, instead i'm getting blanks. It seems the checkArray[i] = letter part doesn't work. How do i make it work ?</p>
  
  <p>Any help will be much appreciated 
  (i hope i have worded the question correctly.. )</p>