我需要基本上創建一個if語句,基本上說「如果數組中字符串的最後一個字母是P,那麼等等等等,但我不知道正確的方法來做到這一點如何使用if語句並搜索數組中的最後一個字母
這是我到目前爲止有:。
public double calculateBonus(String str)
{
double dResult = 0.0;
double dResult = 0.0;
String twoLol = str.substring(0,2);
for (int d=0; d<bonusPts.length; d++)
{
這甚至不是完整的代碼 – smk 2013-03-27 03:20:30
哪裏是數組 – 2013-03-27 03:20:44
'dResult'兩次?所謂的數組在哪裏?它是'bonusPts'嗎? – SudoRahul 2013-03-27 03:21:49