I have a code (Java for example):
boolean A(...){
if (...) return true;
else return false;
}
void C(...){
if (A) {doSomeThing();}
else {doNothing();}
}
But logic is changed and today i need return 3 cases. It look something like this
int A(...){
if (...){ return int;}
else {
if (...) {return int;}
else {return int;}
}
}
void C(...){
if (A == 1) {doSomeThing1();}
if (A == 2) {doSomeThing2();}
if (A == 3) {doSomeThing3();}
}
Is this a best practices or I should use something other instead of "int"? Or I should change my logic and divide it on two boolean? P.S. I know that this questions are fully but it disturbs me.