Java: Breaking Loop -
what best way implement following pseudo-code in java?
method_one(): while(condition_one): execute method_two(); // (a) method_two(): while(condition_two): execute method_three(); // (b) method_three(): if (condition_three): goto execute method_two(); else: //do stuff
edit: prompt replies, everybody. helped lot. figured out now.
if don't need separate methods, should equivalent:
boolean exit_from_three = false; while (condition_one || exit_from_three) { exit_from_three = false; while (condition_two) { if (condition_three) {exit_from_three = true; break;} // stuff } }
Comments
Post a Comment