• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

label continue

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code from whizlabs. Why am I getting compilation error "The label signal is missing" I tried to change as given below but kicked out with "continue cannot be used outside of a loop". Not sure what is happening
 
author
Posts: 23834
140
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The continue statement can only be used for loops -- so with a labelled continue, the label must target a loop.

Henry
 
Saibabaa Pragada
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you mean to say continue is for "for loop" and not for "if loop" ?

Henry Wong wrote:
The continue statement can only be used for loops -- so with a labelled continue, the label must target a loop.

Henry

 
Henry Wong
author
Posts: 23834
140
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Saibabaa Pragada wrote:Did you mean to say continue is for "for loop" and not for "if loop" ?




There is no such a thing as a "if loop". "if" statements are not loops.

Henry
 
Saibabaa Pragada
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My mistake..Thanks for correcting..Let me change my sentence..Did you mean to say continue keyword is applicable for "for loop" only and not for "if statement" ? Please advice if this statement is right.
 
Henry Wong
author
Posts: 23834
140
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Saibabaa Pragada wrote:My mistake..Thanks for correcting..Let me change my sentence..Did you mean to say continue keyword is applicable for "for loop" only and not for "if statement" ? Please advice if this statement is right.



The continue statement may be used for any loop. The while loop, do-while loop, and both variants of the for loop.

Henry
 
Saibabaa Pragada
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great..Thanks Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!