Break should be used either with loop or switch.
Further more Break has two forms Labeled and Unlabeled.
Good example of unlabaled break is, tradional use with switch, loop.
Labeled switch can also be used if we have labeled statements.
Simply using 'break' is compilation error.
Reference:
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/branch.html
No comments:
Post a Comment