可能重复:
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