Hey, I'm having a problem comparing a char to a String. The error is: char cannot be dereferenced. Any suggestions? I've put arrows around the line that holds the error.

Here's my code:

import java.util.*;
import java.util.Scanner;
/** Created by Shakiya Samantha Charles. This code will play one game of very simple hangman.
public class Guess
public static void main(String[] args) throws Exception
Scanner console = new Scanner(System.in);
// Strings the word game for the fixed game.
String targetPhrase = "game";
String displayPhrase = "****";
String inputString;
char guess;
int position = 0;
// Prints welcome message and displays the asterisks.
System.out.println("Welcome to Hangman!");
while (displayPhrase.indexOf('*') != -1)
// Allows use to guess a letter.
System.out.println("Guess a Letter");
inputString = console.next();
guess = inputString.charAt(0);
position = targetPhrase.indexOf(guess, position+1);
if (position == -1)
System.out.println("Sorry - guess again!");
displayPhrase = displayPhrase.substring(0,position) +
guess +
// Displays a winning or losing message.
--------->> if (guess.equalsignorecase( targetPhrase )) <<-----------
System.out.print(" You won! The word is " + targetPhrase);
System.out.print("You lose! Muahahaha");