Break statement vs. a continue statement

Ask a question
          

Break statement vs. a continue statement

<<Previous  Next>>

Java - What is the difference between a break statement and a continue statement? -Jan 15, 2009 at 8:10 am by Rajmeet Ghai

What is the difference between a break statement and a continue statement?  

A break statement when applied to a loop ends the statement. A continue statement ends the iteration of the current loop and returns the control to the loop statement. If the break keyword is followed by an identifier that is the label of a random enclosing statement, execution transfers out of that enclosing statement. If the continue keyword is followed by an identifier that is the label of an enclosing loop, execution skips to the end of that loop instead.

Java What is the difference between a break statement and a continue statement? - Jan 15, 2009 at 7:10 am by Amit Satpute

The break and the continue statements are generally used along with a condition, which when met is executed.

However, a break statement discontinues the execution of the loop and gets the control out of the loop after meeting the condition. On the other hand the continue statement on meeting the condition, goes to the beginning of the loop and reexecutes it. 

Also read

Explain the purpose of yield method.

Yield method causes the currently executing thread object to temporarily pause and allow other threads to execute..................

What is the difference between yielding and sleeping?

Sleep holds the threads execution for the specified time. On the other hand, yield will cause the thread to rejoin the queue..............

What is an Applet?

An applet is a small server side application that can be loaded and controlled on the browser by the client application...............

What is singleton class? Where is it used?

A class is defined as singleton class, if and only if it can create only one object. This class is useful when only one object is to be used in the application.............

<<Previous  Next>> 



Write your comment - Share Knowledge and Experience

Discussion Board
c programming

good views..but no up to mark difference is availeble,,,,of break and continue statement of,,,,c

tamana 01-25-2013 10:51 AM

 

 

 
Interview questions
 
Home | Login | About us | Sitemap | Contact us