in other words, labels can ONLY be used in conjunction with loops.
is therefore illegal code in Java.
is legal if not exactly good coding style
Joined: Aug 28, 2001
Yes, using labels referred to loops is legal in Java. You may hence think it's not the usual coding style. However, for labels that are used in nested loops scenario, it may give you a better idea about the true value of using labels. It gives an alternative to manipulating a couple of indices in a program (which make code less readable).