Hi,
I have a method which have return boolean based on condition ,so i have two retrun statement in a method.I just wanted to know , is it wrong to have two return statment in a method. method is as follow as ..
___________________________________________________________
private boolean isInvalid(String value) {
String sVal[] = { "000000000", "111111111", "222222222", "333333333" };
for (int index = 0; index < sVal.length; index++) {
if (sVal== null || sVal[index].equals(value) ){
return true;
}
}
return false;
}// end of method
______________________________________________________________
Is the above method wrong ,because of it is having two return statemtnts.
Thanks in advance.