dante cass wrote:
As others have already indicated, what you can do, I'll tell you where it is wrong. in your code, even if you enter your for loop, there are chances that if condition was never met, what will happen then?
It is better practice to have one return statement unless until you want to make your code more efficient in some particular situations, Like in a method if execution falls through varied conditions all with if statement, then you will likely to exit as sson as you met one of those. In if..else style, anyway you will exit, if one of hem is met.