Program Flow  «Prev  Next»

Controlling Java program code- Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Each case match in a switch statement must be:
Please select the best answer.
  A. An integer
  B. A character
  C. A constant



2. Which one of the following loop components does the while loop utilize?
Please select the best answer.
  A. LoopCondition
  B. InitializationExpression
  C. StepExpression


3. What differentiates a do loop from a while loop?
Please select the best answer.
  A. The loop condition of a do loop is executed before the loop statement.
  B. The loop condition of a do loop is executed after the loop statement.
  C. The loop statement of a do loop is sometimes never executed.

4. What Java statement do you use to break out of a loop or branch?
Please select the best answer.
  A. break
  B. halt
  C. exit


5. What Java statement is used to skip to the next iteration of a loop?
Please select the best answer.
  A. skip
  B. continue
  C. break


Your score is 0.0