java - forward break label -


how can forward jumps this?? eclipse complaining label1 not found...

thx

public class foo {      int xyz() {         int b = 1;          if (b == 0) {             break label1;         }          // more code here          label1:              return 1;      } } 

you trying use equivalent of goto in java. can't, , reason. abandon ship.

labels included in java sole reason of choosing which loop or switch break out of, in case of nested loops (or switch statements). have no other purpose, , single purpose considered dangerously close goto.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -