Загрузка страницы

Switch Case in Java

Full Java Course: https://course.alexlorenlee.com/courses/learn-java-fast
If you're new to programming, I HIGHLY RECOMMEND solving challenges on Edabit: https://edabit.com/?ref=alexlee

I recommend installing Tabnine autocomplete on your IDE (free and saves you time):
https://www.tabnine.com/get?lang=java&utm_source=youtube.com&utm_medium=Ins&utm_campaign=AlexLee

Disclosure: Edabit and Tabnine links provided are linked to my affiliate accounts & support the channel.

This is how you can use switch case statements in your java programs! ✅Hopefully, what I've taught you will help you with these tricky switch statements.
👑Start practicing now with 10 free java programs - http://alexlorenlee.com/
🌅Source Code - https://github.com/alexlorenlee/JavaTutorialCode/blob/master/Conditionals/SwitchCase.java

If you have if/else if statements comparing one variable over and over, a switch case statement may be easier for you. The layout for a java switch case statement looks like this:

switch(num) {
case 1:
//do this
break;
case 2:
//do this
break;
default:
//do this
}

Switch cases can be better in many situations, but if your code works with if else statements instead, I wouldn't worry about it too much.

This switch statement in java can be tricky at first... But SURELY you'll get it :) If you followed along, congrats! You learned-by-doing!

I hope you enjoyed this tutorial on how to use switch case in java! I like to have a nice mix of java tutorials and actual projects for you all :)

Do you want to learn how to write java code from scratch, in Java? Check out my Java Tutorial For Beginners: https://youtu.be/woJb2hAfkO0

Was this able to get your switch case statement working? -

Free tips and programs: http://alexlorenlee.com
Programmer Humor: https://www.xonot.com - Promo code: "ALEX10" for 10% off

Recommended Channels to Subscribe to
Career Karma: https://youtube.com/channel/UCkCwv67-...
TheNewBoston: https://youtube.com/user/thenewboston

~
https://discord.com/invite/Yk3uqST
https://instagram.com/alexlorenlee
https://youtube.com/channel/UCLkeDGcXfiKlN2imazwkg4A (2nd channel)

Alex Lee

Видео Switch Case in Java канала Alex Lee
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
12 апреля 2019 г. 0:00:03
00:09:30
Яндекс.Метрика