So this is my code. I get the error missing return statement, but I don't see where. Any suggestions would be greatly appreciated.
(I realize there are probably some other issues in this code as well, but for now, I'm just focused on this one since it's currently preventing me from realizing the others.)
(I realize there are probably some other issues in this code as well, but for now, I'm just focused on this one since it's currently preventing me from realizing the others.)
Code:
public boolean addHouse ( House a ) {
boolean done = false;
for (int i = 0; i < collection.length; i++)
{
if (collection[i] == null && done == false)
{
collection[i] = a;
done = true;
return true;
}
else
{
done = false;
return false;
}
}
}
Comment