Java Java Objects Delivering the MVP Exceptions

Brendan Passey
Brendan Passey
999 Points

At this point do we need promptForGuess to return a boolean?

I was going through my code and realised that at this point returning the boolean isHit from promptForGuess doesn't do anything. I imagine we needed it in the past before we set it up to call the applyGuessMethod.

I've made it a void method and taken out the return line and it seems to work fine, am I missing something?

Stivan Radev
Stivan Radev
7,012 Points

Could you post your code here?

1 Answer

Steven Parker
Steven Parker
202,103 Points

You're right, since the return value is being ignored it make no difference if the function has a return or not. Disregarding the return is perfectly safe, though, so converting the function is purely optional.