Q: What is the output of the Java code snippet? int i=0; for(i=1; i<=6;i++) { if(i%3==0) continue; System.out.print(i+","); }
Solution: CONTINUE statement skips the execution of the remaining statements below it.
Q: The Enhanced FOR loop in Java was introduced by ___.
Solution: no solution
Q: An Enhanced FOR loop in Java misses ___ and __ compared to the old-style FOR loop.
Solution: The condition part is not required as the Enhanced FOR loop iterates through all elements of the Collection from staring to end.
Q: In Java language, BREAK or CONTINUE statements can be implemented inside a Loop only with the help of ___ statements to avoid never-ending loops.
Solution: no solution
Q: What is the output of the Java program with Enhanced FOR loop below? String countries[] = {"BRAZIL", "CHILE", "SYDNEY"}; int i=0; for(String str: countries) { if(i<2) ; else break; System.out.print(str + ","); i++; }
Solution: no solution
Q: What is the output of Java Enhanced FOR loop below? String names[] = {"MOGLI", "SHAREKHAN", "BALU"}; for(String str: names) { System.out.print(str + ","); }
Solution: no solution
Q: An enhanced FOR loop work with only Collection type data. Examples of Collection are ___.
Solution: no solution
Q: A BREAK or CONTINUE statement applies only to the ___ loop.
Solution: no solution
Q: A BREAK-WITH-LABEL or CONTINUE-WITH-LABEL are used in particular in Java to select __ loop either to Break or Continue.
Solution: Use the Labels only to choose outer loops. Otherwise, simply use BREAK or CONTINUE without any label.
Q: Choose rules for naming a Label in Java below.
Solution: no solution
You Have Score    | /10 |