简体   繁体   中英

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. binaryHashResult is an array and innerNode is a List . I want to check if all values in array exist in 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM