Prev Next

Java / Control Statements

How will you exit anticipatedly from a loop?

Using the break statement, we can terminate the execution of a loop immediately.

for (int i = 0; ; i++) {
    if (i > 10) {
        break;
    }
}

More Related questions...

Show more question and Answers...


Comments & Discussions