:a
第一种,执行
第一种,继续执行
第二种,继续执行
输出打印结果:d
over
if语句特点:
fa每一种格式都是单条语句。b第二种格式与三元运算符的区别:三元运算符运算完要有值出现。好处是:可以写在其他表达式中。c条件表达式无论写成什么样子,只看最终的结构为是true或者false(2)选择结构switch语句格式:switch表达式case取值1定义被选答案执行语句;break;跳出switch语句case取值2执行语句;break;default执行语句;break;
默认情况
i
ta4b2charchswitchchcaseSystemoutpri
tl
abbreakcaseSystemoutpri
tl
abbreakcaseSystemoutpri
tl
abbreakcaseSystemoutpri
tl
abbreakdefault
输出打印结果:6
fSystemoutpri
tl