Javatpoint Logo

91-9990449935

 0120-4256464

Java Switch Statement

The Java switch statement is executes one statement from multiple conditions. It is like if-else-if ladder statement.

Syntax:

flow of switch statement in java

Example:

Output:

20

Java Switch Statement if fall-through

The java switch statement is fall-through. It means it executes all statement after first match if break statement is not used with switch cases.

Example:

Output:

20
30
Not in 10, 20 or 30
Next TopicJava For Loop