Thursday 18 November 2010

Difference b/w break and continue statements

 Difference b/w break and continue statements

      Break
      Continue
      1) it executes the loop
      1) it continues the loop
     2)the main loop of break statements is escape from the block
     2)generally use of continue statements is to prefer next iteration of the loop
      3)syntax- break;
      3)syntax- continue;
     4)break can be used in forloop,whileloop, do whileloop and switch statements 
     4) continue can be use in for loop, while loop, do while loop but not in switch statements.
     5) it is more useful than continue
     5)it is less useful than break


Statements

No comments:

Post a Comment