Quiz on Java Continue Statement
The continue statement in Java is used to skip the current iteration of a loop and proceed to the next iteration. It is commonly used in for, while, and do-while loops when a specific condition is met.
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
- Question 1 of 15
1. Question
What is the primary purpose of the continue statement in Java?
CorrectIncorrect - Question 2 of 15
2. Question
In which types of loops can continue be used?
CorrectIncorrect - Question 3 of 15
3. Question
What will the following code print?
for (int i = 1; i <= 5; i++) {
if (i == 3) continue;
System.out.print(i + ” “);
}CorrectIncorrect - Question 4 of 15
4. Question
What happens if you place continue outside any loop?
CorrectIncorrect - Question 5 of 15
5. Question
Which keyword can be used with continue to jump to an outer loop?
CorrectIncorrect - Question 6 of 15
6. Question
What will be the output?
int i = 0;
while (i < 5) {
i++;
if (i == 2) continue;
System.out.print(i);
}CorrectIncorrect - Question 7 of 15
7. Question
Which of these is a correct labeled continue syntax?
CorrectIncorrect - Question 8 of 15
8. Question
What will the following code print?
outer:
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 3; j++) {
if (j == 2) continue outer;
System.out.print(i + “” + j + ” “);
}
}CorrectIncorrect - Question 9 of 15
9. Question
Can continue be used to skip certain conditions in do-while loop?
CorrectIncorrect - Question 10 of 15
10. Question
Which statement is true about continue and break?
CorrectIncorrect - Question 11 of 15
11. Question
What will be the output?
for (int i = 1; i <= 3; i++) {
System.out.print(“A”);
continue;
// System.out.print(“B”); // Line X
}CorrectIncorrect - Question 12 of 15
12. Question
How does continue affect loop counters?
CorrectIncorrect - Question 13 of 15
13. Question
Which keyword can never appear with continue?
CorrectIncorrect - Question 14 of 15
14. Question
Which of the following uses of continue is legal?
CorrectIncorrect - Question 15 of 15
15. Question
What’s the result of this?
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (j == 1) continue;
System.out.print(i + “” + j + ” “);
}
}CorrectIncorrect
Summary
The Java continue statement is a control flow tool that allows skipping the current loop iteration and continuing with the next cycle. It is useful for filtering specific conditions without breaking the loop.
