0

Can I get explained for this in Java

The parameter weekday is true if it is a weekday , and the parameter vacation is true if we are on vacation . We sleep in if it is not a weekday or we're on vacation . Return true if we sleep in.

9th Aug 2020, 2:45 PM
Moutasem
3 ответов
0
I tried this : Public boolean sleepIn (boolean weekday , boolean vacation) { if (weekday == true || vacation == false ){ return false ; } return true ; } So I got thia and It's fel !! SleepIn(false , false )[true] -> false SleepIn(true , false )[false] -> false SleepIn(false , true )[true] -> true SleepIn(true , true )[true] -> false
9th Aug 2020, 2:52 PM
Moutasem
0
Are you mean it is failing any case? How?
9th Aug 2020, 3:46 PM
Jayakrishna 🇮🇳
0
if (weekday == true || vacation == true ){ return true ; } return false; // same as return weekday || vacation;
9th Aug 2020, 7:23 PM
zemiak