Q: State TRUE or FALSE. You can exit an inner loop without using a BREAK statement but with a CONTINUE and Label on the outer loop.
Solution: no solution
Q: The keyword "goto" can be used in Java programs with labels. (TRUE/FALSE)
Solution: The keyword "goto" is still a reserved keyword. It can not be used.
Q: Is it possible to break all loops with a single BREAK with a Label statement? (YES/NO)
Solution: no solution
Q: What is the output of the Java code snippet below? outer: for(int i=1; i<=4;i++) { inner: for(int j=1; j<=4;j++) { if(j==1) break outer; } System.out.print("A"); }
Solution: Even before reaching the PRINT statement, the outer loop will stop because of BREAK outer.
Q: What is the output of the below Java program? outer: for(int i=1; i<=2;i++) { inner: for(int j=1; j<=2;j++) { if(j>i) break inner; System.out.print(j +","); } }
Solution: no solution
You Have Score    | /5 |