The if statement is redundant in Java
<p>I am getting a lightbulb on NetBeans saying "The if statement is redundant"</p>

<p>I want to know how these two are equal to one another</p>

<pre><code>public boolean isVowel(char in)
{
    char temp = Character.toLowerCase(in);

    if (temp == 'a' || temp == 'e' || temp == 'i' || temp == 'o' || temp == 'u')
    {
        return true;
    }
    else
    {
        return false;
    }
}
</code></pre>

<p>and</p>

<pre><code>public boolean isVowel(char in)
{
    char temp = Character.toLowerCase(in);

    return temp == 'a' || temp == 'e' || temp == 'i' || temp == 'o' || temp == 'u';
}
</code></pre>

<p>I can see how it would return true if one of the vowels matches with temp. However, I am not seeing how it would return false. Would it simply just return false if none of the conditions are met? </p>

<p>Solved: I was looking at the problem the wrong way. For it to return false, each conditional statement would have to be false. Ideally it would return false if the return statement was equivalent to:</p>

<pre><code>return false || false || false || false || false;
</code></pre>

<p>and true if any one condition is met</p>

<pre><code>return false || false || false || false || true;
</code></pre>

<p>Thanks you guys, it really helped. </p>