yes, that's actually the only place i used it, in a for-loop sort of the same concept as nesting a switch statement in a while-loop (if the array is full, it would move onto the code that would grow the array):

Alot of the "bad style" mentality stems from pre 80s compiler design issues where labels (and goto statements) totally mucked with what the compiler could do...much of this is no longer the case. This is not to say either should be overused, but if you'd need to jump-through-hoops or introduce some (otherwise useless) state variables to avoid coding something what would be cleaner with label/gotos...you're probably doing it wrong.

Alot of the "bad style" mentality stems from pre 80s compiler design issues where labels (and goto statements) totally mucked with what the compiler could do...much of this is no longer the case. This is not to say either should be overused, but if you'd need to jump-through-hoops or introduce some (otherwise useless) state variables to avoid coding something what would be cleaner with label/gotos...you're probably doing it wrong.

It can also make programs hard to follow since your jumping around a lot, hence why it is sometimes called spaghetti code.

To be honest I wouldn't use labels unless you can't find a way to do what you want to do without them (at least not easily), the trick is to not use a lot of them because then that becomes spaghetti like code

I did read what you wrote, I was adding the information about spaghetti code, and then giving my opinion on the use of labels... Only the first sentence was in reply to your post, I didn't separate it correctly from my opinion. I was agreeing with you and adding information on where the "bad style" mentality comes from, so why do I need to re-read your post.

Duely noted. Ultimately pretty much any programming construct can be misused and produce bad and/or hard to read code. An unfortunate side-effect of this is that some very useful constructs get a bad-rap. The main place where labels are very useful (that I can think of off the top of my head) is state-machine like processing. Examples include core stream input/output and interpreters.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org