How to pass a boolean and verify a boolen in an if statement?
<p>OK I'm on the final part of my game, then I will invite you all to play. Its not perfect by no means, but its a huge milestone in my Java progress.
So in my code I'm calling my puzzle class to verify if the solution given by the user <code>equalsIgnoreCase</code> of the private variable solution provided in the puzzle class. If they match it returns true, else, it returns false. On the tester, if I get the true value returned, it should print I was right and if it returns false I get it wrong.
The problem is that I type it in right, but it tells me I'm wrong. Why?</p>

<p>puzzle:</p>

<pre><code>    public boolean solvePuzzle(String answer)
    {
        if(this.solution.equalsIgnoreCase(answer))
        {
            return true;
        }
        else
        {
            return false;

        }

    }

}
</code></pre>

<p>puzzletester:</p>

<pre><code>    if(choice==2)
   {
        System.out.println("Please solve the puzzle");
        input.nextLine();
        String answer=input.next();
        answer=answer.toUpperCase();
        game.solvePuzzle(answer);

        if(game.solvePuzzle(answer)==true)
        {
        System.out.println("That is correct");
        }
        else
        {
        System.out.println("You are wrong");
        }
        }


        }
</code></pre>
