title: Cannot invoke equals(char) on the primitive type char
body: <p>I'm new to programming and trying to nut out a basic guessing game, but I have this error. Need some help as I've set 'guess' to <code>char</code>, then want to compare it to the array of chars but tried a couple of different approaches but no joy yet.</p>
  
  <p>It gives me the error on the if statement at the bottom containing:</p>
  
  <pre><code>(guess.equals(wordContainer[j]))
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p>My code:</p>
  
  <pre><code>import java.util.Scanner;  
  
  public class GuessingGame {
  
      public static void main(String args[]) {
  
          Scanner keyboard = new Scanner(System.in);
  
          String wordArray[] = {"aardvarks", "determine", "different", "greatness", "miserable", "trappings", "valuables", "xylophone"};
  
          double rand = Math.random() * 8;
          int x = 0;      
          x = (int)rand;      
  
          System.out.println(x);
  
          String word = wordArray[x];
          int wordCount = word.length();
  
          System.out.println(word);
         // System.out.println(wordCount);
  
          char wordContainer[] = new char[wordCount];
          char wordHiddenContainer[] = new char[wordCount];
  
          String input;
          char guess;
  
          System.out.print("Enter your guess(a-z): ");
          input = keyboard.next();
          guess = input.charAt(0);
  
          for ( int i = 0 ; i &lt; wordCount ; i++ ) {           
              wordContainer[i] = word.charAt(i);
              wordHiddenContainer[i] = '*';           
          }
  
          System.out.println(wordContainer);
          System.out.println(wordHiddenContainer);
  
          for (int j = 0; j &lt;  word.length(); j++ ) {
              if(guess.equals(wordContainer[j])) {                
                  wordHiddenContainer[j] = guess;
  
              }           
          }
      }   
  }
  </code></pre>