Ask Question

When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.

+5
Answers (1)
  1. 2 October, 00:09
    0
    True

    Explanation:

    While looping through, there can be times that you do not want your code to do anything in some situations. Let's say you loop through an array consists of four numbers (1, 2, 3, and 4). You want to print all the values except 2. Check the code written in Java below.

    int [] numbers = {1, 2, 3, 4};

    for (int number : numbers) {

    if (number = = 2) {

    continue;

    }

    System. out. println (number);

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers