0
Can the else-part be empty?
Can the else-part be empty?
5 Answers
+ 6
yes, you can leave it empty. But the program will only execute the first statement since the counter statement supposed to be in the else section is not available. it is acailable to not leave it empty so as to have different arguments.
+ 4
Yes if you don't need that make it empty or do not create it.
+ 1
it make the only 'if' statement
+ 1
when the else part is false or empty then it not execute the else expression output .
it make only if statement ....
0
yes, it can, but then it makes more sense to create/have an if condition without the else part, like:
if (condition) {
do-something
}