+ 4

Where is error in Java program (comment 1 or 2 or 3)?

// Where is error in Java program (comment 1 or 2 or 3)? public class Program { public static void main(String[] args) { label: { // 1 break label; // 2 continue label; // 3 }}}

29th May 2019, 7:30 PM
ŠŠ½Š“рŠµŠ¹ Š§Š°Ń‡ŠøŠ½, Andrew Chachin
ŠŠ½Š“рŠµŠ¹ Š§Š°Ń‡ŠøŠ½, Andrew Chachin - avatar
2 Answers
+ 13
Error in 3, because continue must be inside a loop
29th May 2019, 7:42 PM
Javier Felipe Toribio
Javier Felipe Toribio - avatar
+ 2
break label will exit loop, continue is unreachable code
29th May 2019, 7:44 PM
HNNX šŸæ
HNNX šŸæ - avatar