Given a sample code:
1 public class Test2 {
2 public static void main(String[] args) {
3 int i = 3;
4 System.out.println("start");
5 switch (i) {
6 case 3:
7 continue;
8 case 4:
}
9 System.out.println("end");
}}
What will be result when compiled and run?
(A) start
(B) end
(C) start end
(D) Compilation error at line no-7.
(D)
continue cannot be used outside of a loop
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.