Home » Java Basics » switch statement

switch statement

Java Switch-Case Example

Java provides decision making statements so as to control the flow of your program. These statements are: if...then if...then...else switch..case In this example, we will show how to use the switch case statement. A switch statement checks if a variable is equal to a list of values. The variable in the switch statement can be a byte, short, int, or ...

Read More »

Free Flowing Switch Statement

With this example we are going to demonstrate how to create a free flowing switch statement. A free flowing switch statement is a switch statement where break statement is not specified, thus all cases after the matching one (including the default) will be executed. In short, to create a free flowing switch statement you should: Create a switch statement that evaluates ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns