Learn Programming in Java - Lesson 09 : Switch / If-Else Ladder

preview_player
Показать описание
This lesson, a continuation of lesson 08 explores two more branching structures in Java: the switch statement and the if-else ladder. In the example from this lesson we write a program which converts a date like 2/23 into a string like "February 23rd." In the second half of the episode we'll cover enumerations, explaining the benefits of making your own data type and values.
Рекомендации по теме
Комментарии
Автор

I'm a bit late to the party here, but learning Java so this is all very new to me - your videos have been great! Thanks for sharing.

dbchud
Автор

Thank you Michael!! Your tutorial is straightforward and easy to understand

TusharShetty
Автор

Thanks man, my grade would be totally Fudged without you

DrewDavisPiano
Автор

This exercise would have been so much easier if the first three ordinal numbers were were "firth, " "seconth, " and "thirth."

OriginalPhil
Автор

hi mike im getting an error on the public static String monthName

are
Автор

Thanks for your helpful lessons but I am a beginner in learning java programing and I wonder how to import the projects that you imported from the Github to the Neatbean? Indeed I don not know how to import projects into Neatbeans; every time I tried I encountered to some errors.

atefemoradan
Автор

I Have A ANother Question....
In the Switchcaseandifelseladder program...if i need to show an exception of the number of days in February....So what should be done in order to show the exception of February too???
Please

ShahbazSholapure
Автор

Hello, DO you have another tutoril of java lecturing how to design a simple project using java with few feature, like login and registration, view users registered, edit.update and logout and delete

kabodasugwejo
Автор

thank you for all these videos. i am a starter in java programming, any advice on how to make it easier for me?

stephenseesay
Автор

Hi Mike, thanks very much for the lessons it's really very helpful.
I wanted to ask a question regarding the switch case statements in Activity 3, the public method value() in the ATMmenu enum should return a string ... I was trying to use this string in the case statement but it was wrong syntax then I created a variable string that holds the value of the enum and tried to use it in the comparison but it also didn't work. please see below
.
.
String Choice = input.nextLine();
String withdrawal = ATMMenu.Withdrawl.Value();

switch (Choice)
{
  case withdrawal: ---> wrong Syntax



String Choice = input.nextLine();

switch (Choice)
{
  case ATMmenu.Withdrawl.Value(): ---> wrong Syntax also.



is there any workaround for this or I should use only constant values (not variables) in the switch case statements ?

hythamelsohl
Автор

how would you determine the month number to the month name? Like if the user input an 6 then input June and it will match or not match?

sonjiagonzales
Автор

you have mistake day%10==1  should be all together, or it brings error

markomiljkovic