How many times will the loop body be executed?
int counter = 0;
boolean shouldBeStopped = false;
while (!shouldBeStopped) {
if (counter == 3) {
shouldBeStopped = true;
}
counter++;
}How many times will the loop body be executed?
int counter = 0;
boolean shouldBeStopped = false;
while (!shouldBeStopped) {
if (counter == 3) {
shouldBeStopped = true;
}
counter++;
}Create a free account to access the full topic