Is there any difference between using multiple if statements and else if statements?

后端 未结 4 515
情深已故
情深已故 2021-02-01 14:46

This question pertains specifically to shell scripts, but could be about any programming language.

Is there any difference between using multiple if stateme

4条回答
  •  独厮守ぢ
    2021-02-01 15:04

    It has to do with efficiency and your needs. If statements are executed independent of one another; each one will run. Else if statements only execute if the previous ifs fail.

提交回复
热议问题