[英]What does the : do in java?
我在 CodeHS 中為學校做了一些練習,多個答案告訴我在條件語句中使用:是不正確的。 我想知道它是否真的有效,或者根本不應該使用它。 代碼附在下面。
int[] highTemp = {88, 92, 94, 90, 88, 83};
int target = 90;
int count = 0;
for (int temp : highTemp)
{
if (highTemp >= target)
{
count ++;
}
}
System.out.println(count);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.