Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

continue?  RSS feed

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've noticed that the command prompt does not accept negative numbers whether the statement (commented below) is commented or left without comments. What is the use of continue? Were there any applications where you had to use them, and, can you provide examples or code snippets?

 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Branching Statements
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I find a labeled "continue'' to be very helpful when breaking out of nested loops.
I also use "break" with a label, except from within a switch. Always using labels
is just my conservative nature. I like to see exactly where the code will land.

Jim ...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!