Java 编程/关键字/else
外观
else
是一个 Java 关键字。它是分支语句的一个可选部分。它启动“错误”语句块。
branching-statement ::=if
condition-clause single-statement | block-statement [else
single-statement | block-statement ] condition-clause ::=(
Boolean Expression)
single-statement ::= Statement block-statement ::={
Statement [ Statement ]}
比如
if ( expression ) {
System.out.println("'True' statement block");
} else {
System.out.println("'False' statement block");
}
|
参见