does the

return false

statment at the end of the method, will return false, only if none of the switch-case conditions will occure ? or that the recursive call can impact on it and use it in any other term ?



Every case finishes with a return, so the extra return false will only be executed if none of the cases is true.
Sometimes this happens with the Java compiler. You know that every possible data will lead to one of your retunrs, but the compiler spots a theoretical possibility that it might not, so you have add an extra return to keep it happy.

Have you tried executing it yet? running test cases will tell you everything you need to know.

Edited by JamesCherrill


the return false will only be executed if none of the if statements and none of the case statements are executed.


Thanks guys for all of your help.
I really appreciate that !

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.