W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
if boolean_expression_1 { / Executes when the boolean expression 1 is true / if boolean_expression_2 { / Executes when the boolean expression 2 is true / } }
String pinCode = '12345'; String customerType = '12345'; if (pinCode == '12345') { System.debug('Condition met and Pin Code is'+pinCode);
</span><span>if</span><span>(</span><span>customerType </span><span>==</span><span> </span><span>'Premium'</span><span>)</span><span> </span><span>{</span><span>
</span><span>System</span><span>.</span><span>debug</span><span>(</span><span>'This is a Premium customer living in pinCode 12345');
}
else if(customerType == '</span><span>Normal</span><span>') {
System.debug('</span><span>This</span><span> </span><span>is</span><span> a </span><span>Normal</span><span> customer living </span><span>in</span><span> pinCode </span><span>12345</span><span>');</span><span>
</span><span>}</span><span>
}else { //this can go on as per the requirement System.debug('Pincode not found');}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: