①if(condition)
{
conditon为ture时,执行{ }内的代码
}
②if(conditon)
{
conditon为ture时,执行{ }内的代码
}
else
{
conditon为flase时,执行else—{ }内的代码
}
③if(conditon1)
{
条件为conditon1为ture时,执行{ }内的代码
}
else if(conditon2)
{
conditon1为flase,conditon2为ture,执行{ }内的代码
}
else
{
conditon1, conditon2全为false,执行else—{ }内的代码
}