我陷入了一個問題。我有以下方法:關於字節條件
public byte determineCardType(final IInput inputData) {
byte cardType = UNKNOWN_CARD;
try {
if (isWagRewardsLoyaltyCard(inputData))
cardType = WAG_LOYALTY_CARD_TYPE;
else if (isDRCard(inputData)) //checking that card scanned and swiped is a DR Card
cardType = DR_CARD_TYPE;
else if (isWagRewardsPartnerCard(inputData))
cardType = AARP_CARD_TYPE;
return cardType;
} catch (Exception e) {
return UNKNOWN_CARD;
}
}
}
然後,我有另一塊代碼,其中我檢查從上述方法返回的卡類型。
if((aarpCardSupport.isAARPCard(input))||(determineCardType(input)==DR_CARD_TYPE))
{
return true;
}else if((isDRCard(input))&&(isDRLoayltyEnabled())) //would return 1 for DR card only when isDRLoayltyEnabled returns true
{
return true;
}
return false ;
}
但在上面的代碼所示determinecardtype是顯示,因爲它的返回類型的錯誤字節,並使用
if((aarpCardSupport.isAARPCard(input))||(determineCardType(input)==DR_CARD_TYPE)) ,
請告知我不能比的。
哪個錯誤?什麼是大寫常量的類型? – UmNyobe 2012-04-23 10:57:06
你爲什麼要出門? – 2012-04-23 10:59:25