Yes, it works, but only up to a single line just after an 'if' or 'else' statement. If multiple lines are required to be used then curly braces are necessary.
The following will work
if(foo)
Dance with me;
else
Sing with me;
The following will NOT work the way you want it to work.
if(foo)
Dance with me;
Sing with me;
else
Sing with me;
You don't know anything;
But if the above is corrected as in the below given way, then it works for you:
if(foo){
Dance with me;
Sing with me;
}else{
Sing with me;
You don't know anything;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…