[英]how execute if condition several times without break inside for loop in java?
In the following code I want to execute the if
condition inside the outer for
loop several times, but in the following code it only executes once and executes the steps after it. 在下面的代码中,我想多次在外部
for
循环内执行if
条件,但是在下面的代码中,它仅执行一次,然后执行之后的步骤。 binaryHashResult
is an array
and innerNode
is a List
. binaryHashResult
是一个array
而innerNode
是一个List
。 I want to check if all values
in array
exist in list
. 我想检查
array
中的所有values
是否存在于list
。
for (int j = 0; j < binaryHashResult.length; j++)
if (innerNode[binaryHashResult[j]] == 1.0)
for (int h = 0; h < m.children.size(); h++) {
BloomFilterIndex.BFINode<Integer> s=m.children.get(h);
searchencryptedNode(binaryHashResult, e, k, s);
}
Always wrap blocks of code with {} regardless if the block has only one line. 始终用{}包装代码块,无论该块只有一行。
for (int j = 0; j < binaryHashResult.length; j++)
if (innerNode[binaryHashResult[j]] == 1.0) {
for (int h = 0; h < m.children.size(); h++) {
BloomFilterIndex.BFINode<Integer> s=m.children.get(h);
searchencryptedNode(binaryHashResult, e, k, s);
} // closes inner for loop
} // closes if
} // closes outer for loop
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.