Learn Java in 2018, Switch Statements, Learn Java on Codecademy

Lesson Summary

Switch statements in java allow us to run code that meets a condition. Java will execute code blocks depending on if specific cases equal a specified value. A switch statement is similar to a if / else if/ else statement. It is cleaner code and there is a default statement that is similar to an else statement which will run if all other cases fail.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required