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
Post a Comment