0

Why is my if statement with an or operator not working?

https://code.sololearn.com/clPSpRmYguV6/?ref=app

17th Aug 2018, 2:14 AM
David
3 odpowiedzi
+ 3
Like this it works: if (inputMonth.equals("Jan") || inputMonth.equals("Mar")) What is before and after || has to result in 0 or 1.
17th Aug 2018, 2:30 AM
Paul
Paul - avatar
+ 1
you can put as many || in an if sentence as you want, so you can just write other months in the same if statement
17th Aug 2018, 6:04 AM
Data
Data - avatar
0
do i have to do || inputMonth.equals() 5 more times cause i have 5 more months to put in. is there a way to condense it
17th Aug 2018, 2:38 AM
David