Oracle Certified Associate Java Se 8 Programmer · Free Practice Question Hard

Question 8

Consider the code:

What is the result?

  • A

    2

  • B

    1

  • C

    6

  • D

    0

Reveal correct answer

Correct answer: C

Explanation

Within the switch statement if any case is matched then from that case onwards all statements will be executed until break or end of the switch. This is called fall-through inside switch.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need