... conditional assemble expression 条件汇编表达式 simple conditional expression 简单条件表达式 post-conditional expression 后置条件表式 ...
基于22个网页-相关网页
As in most every language, Scala's if evaluates a conditional expression, then proceeds to a block if the result is true or branches to an alternate block if the result is false. A simple example.
和大多数语言一样,Scala的if测试一个条件表达式,然后根据结果为真或假来跳转到响应语句块中。
In general, you can replace a conditional statement with a conditional expression if both branches contain simple expressions that are either returned or assigned to the same variable.
一般来讲,你可以用条件表达式来替换掉条件语句,无论这些语句的分支是返回语句或者是赋值语句。
应用推荐