更新时间:2023-11-29 19:20:52
使用的增强的for循环,您可以轻松地遍历数组,不需要索引和大小计算:
Using the enhanced for loop, you can easily iterate over an array, no need for indexes and size calculations:
private static boolean allTrue (boolean[] values) {
for (boolean value : values) {
if (!value)
return false;
}
return true;
}