How could I write cod to show how many days in a month in Java? | Sololearn: Learn to code for FREE!
+ 1

How could I write cod to show how many days in a month in Java?

February has 28 days November, April, June and September have 30 days and the rest have 31 days

5th Feb 2019, 7:22 AM
Ahmad AlOsta
Ahmad AlOsta - avatar
3 Answers
+ 2
If you don't want to use switch, just convert everything to if-else if statements. https://www.sololearn.com/learn/Java/2205/?ref=app
5th Feb 2019, 11:07 AM
Lambda_Driver
Lambda_Driver - avatar
+ 1
Thanks. But can I have it without switch?
5th Feb 2019, 8:47 AM
Ahmad AlOsta
Ahmad AlOsta - avatar