I just wanted to know all other codes on which java labels can be applied. I only know that labels can be applied on loops.
In Kathie Sierra It was written that:-
Although many statements in a java program can be labeled, it's most common to use labels with loop statements...
From Link: Can a label block be used without loop
I get reference that label can be applied on blocks or can be used with single statement like :
hello: break hello;
Still question is can we apply label on any statement or block...
label1:int a=3; //ERROR
label1:{int a=3; } //legal
Why??