can we have default statement in if and else ? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

can we have default statement in if and else ?

9th Dec 2016, 2:32 PM
Mallareddy Avinash
Mallareddy Avinash - avatar
4 ответов
0
No To use default is just for switch case statements as far as I know .
10th Dec 2016, 3:04 PM
Anand Chourasiya
Anand Chourasiya - avatar
0
If you think about it, the "else" part of the statement is the default.
20th Dec 2016, 5:29 AM
Dustin
0
Oh yes I see
26th Jun 2017, 1:25 PM
Anand Chourasiya
Anand Chourasiya - avatar
- 1
nope, we have if else if structure, in the end just use final else. serving as default mode but I ve never tried to check it out, let's see if it works
9th Dec 2016, 3:19 PM
Morpheus
Morpheus - avatar