Switch Statements | Java | Tutorial 18

preview_player
Показать описание

Throughout the course we'll be looking at various topics including variables, arrays, getting user input, loops, conditionals, object orientation, and much more.
Рекомендации по теме
Комментарии
Автор

Wonderful video! I edited ur code a bit by giving info about day abbreviations and used the input thing, it was fun.

ayushreemohanty
Автор

Thank you very much
It is Very good explanation 👏

znoran
Автор

Thanks bro this vdios that you prepared is excellent

asliddinibrogimov
Автор

As always, thank you Mike for your effort!
Here's a problem I got: I don't really realize how _break_ functions exactly. Mike explained it and it sounds perfect, but it also sounds nothing wrong to me even if we don't add it.
Well, as expected it doesn't go well. Every _dayNum_ I give generates the same result _Saturday_ . And this is the other problem I got - I kinda want to know by what logic Java gives me this answer.
Just leave some of my thoughts here. Thanks if everyone gives an answer!

huskyshikakatan
Автор

Add return dayName; at the end to ensure that the method returns the dayName string without getting an error 👍

kholofeloramasodi
Автор

All I'm doing is copying your code and it pretty much sticks! Awesome videos mate!

joshwetherill
Автор

This code is cleaner but I’m not sure if it’s more efficient or creates shorter code?

amc
Автор

This program didn't run for me. It says "Error:(35, 5) java: missing return statement". Spent a while trying to figure it out. No luck. I think basically, it needs a "return" statement in it. I really don't know though.

RoySmith
Автор

Sir, is it possible to write return statement inside switch-case statement, if not, then why not and if yes, then how?

rajbindersingh
Автор

2:05 In the C# Switch Statements tutorial, the dayName string variable wasn't set equal to empty parenthesis. It was just ' String dayName; ' That same omission of = "" works here in Java. Is it just formality to write that in?

scottisitt
Автор

My code doesn't want to run. Please

stefandjordjevic
Автор

return dayName; must be inserted out of swith statement

hammerod
Автор

very authentic programming language me think !

ihssancanmturk
Автор

the code I am using is exactly like yours but i an getting the error "Error: could not find or load main class" what did I do wrong?

grymwuld
Автор

Then, why don't we copy else if numerous times to achieve the same result? Why pay the effort to learn this?