if else if else if else 的用法

Posted konglxblog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了if else if else if else 的用法相关的知识,希望对你有一定的参考价值。

if (boolean) {
//如果boolean为false的话跳过这里代码 执行下面else if。
//如果boolean为true 的话执行完这里的代码,然后直接跳出,到方法 toast("你好")处
}
else if (boolean){
//如果boolean为false 的话 继续执行后面else if。
//如果boolean为true 的话执行完这里的代码,然后直接跳出,到方法 toast("你好")处
}
else if (boolean){}...
else {
//如果上面的所有if else if 都不满足的话,执行这里
}
toast("你好");

以上是关于if else if else if else 的用法的主要内容,如果未能解决你的问题,请参考以下文章

if...else if...else和switch语句的注意点,以及和js的if...else if...else的不同

html 基本IF,IF - ELSE和IF - ELSE IF - ELSE语句。

R语言中的if else语句

为啥JAVA源码中if else大都省略else,怎样的条件能够省去else?

if--else 嵌套 怎么理解?

if else if else if else 的用法