Programming/Java2014. 3. 10. 16:32
java에서는 goto가 없지만 break와 continue에 label을 지원한다.
[링크 : http://stackoverflow.com/questions/2545103/is-there-a-goto-statement-in-java]

 The break statement terminates the labeled statement; it does not transfer the flow of control to the label. Control flow is transferred to the statement immediately following the labeled (terminated) statement.

[링크 : http://stackoverflow.com/questions/14960419/is-using-a-labeled-break-a-good-practice-in-java

단, 반복문과 라벨 사이에는 어떠한 문장도 들어가서는 안되며 무언가가 삽입되었을 시에는
"The label -label name- is missing"이라는 에러가 발생된다.


[링크 : http://docs.oracle.com/javase/tutorial/java/nutsandbolts/branch.html]
Posted by 구차니