 <p>A method which declares a return type must declare a return statement for every possible branch of flow of that method. Which means basically there is a flow of code possible in your method which does not end in a return statement (hint: what happens if your <code>if</code> statement returns false inside the loop every time? Eventually the loop will end and nothing will be returned.)</p> <p>You can put a catch-all return statement at the bottom of your method doing something like returning <code>null</code>, or perhaps even throwing an <code>Exception</code> which will allow you to not "return anything"</p>