#1,125 – Use of break and continue Statements

You can use the break statement to break out of a loop or switch statement, resuming execution at the endpoint of the enclosing statement.

You can use break within a switch statement or within while, do, for or foreach loops.

You can use the continue statement to jump unconditionally to the endpoint of the body of statements enclosed within a loop.  This will either cause execution to continue with the next iteration of the loop or will continue execution after the loop if the final iteration was being executed.

You can use continue within a while, do, for or foreach loop.

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #1,125 – Use of break and continue Statements

  1. Pingback: Dew Drop – June 25, 2014 (#1803) | Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: