可能重複:
Java: What does the colon (:) operator do?的instanceof在Java
for (CreditCard cc : credit1)
&
if (index instanceof RewardCard)
是 「:」 和的instanceof一樣嗎?所以我可以使用?
if (index : RewardCard)
或
for (CreditCard cc instanceof credit1)
如果沒有,可以有人解釋一下 「:」 是什麼意思?
你嘗試它是相似的? – cheeken 2012-07-26 04:00:21