the return statement is available and the compiler still asks for it
<p>I have the below posted method, and as shown it return Boolean data type. I wrote the return statement but though, the compiler gives me an error saying: this method must return a result of type boolean.</p>

<p>Java code:</p>

<pre><code>public boolean isExistGuess(int guess, ArrayList&lt;Integer&gt; arraylist) {
    boolean found = false;

    if (arraylist.isEmpty())
        return false;

    for (int i=0; i &lt; arraylist.size(); i++) {
        if (arraylist.get(i) == guess)
            return true;
        else continue;
    }
}
</code></pre>
