if文を使用することで処理の条件分岐を実装することができる。

 

実装例

if(1 > 2) {

    print(111)

} else if(2 > 1) {

    print(222)

} else {

    print(333)

}

 

出力結果

222