12. Java Switch

preview_player
Показать описание
Java Switch Statements
Instead of writing many if..else statements, you can use the switch statement.
The switch statement selects one of many code blocks to be executed
The break Keyword
When Java reaches a break keyword, it breaks out of the switch block.
The default Keyword
The default keyword specifies some code to run if there is no case match:
Рекомендации по теме
welcome to shbcf.ru