if 语句
if (test-condition)
statement
if (test-condition)
statement
else
statement
?
condition: trueValue : falseValue
switch
switch(integer expression){
case label1 :statement
case label2 :statement
default : statement
}
这里添加图例
逻辑表达式
运算符 | 解释 |
---|---|
|| | 或 or |
&& | 且 and |
! | 非 not |