I'm writing java code which includes some nested if else statements. The goal is to have the program continue on through each step until you don't meet the current condition. However, at the moment only the else statement is being honored. If I take the 2 nested else statements out, then I can never get the outermost else statement to work. Can anyone see what's going wrong or suggest a better way to achieve the desired result?
I have some pseudo-code below:
if (condition 1) {
do something 1
if (condition 2) {
do something 2
if (condition 3) {
do something 3
}
else {
do something else 3
}
}
else {
do something else 2
}
}
else {
do something else 1
}
Many thanks.
Aucun commentaire:
Enregistrer un commentaire