If statement does not print out the body when the condition has met : <p>I expect the output will be the string in the wordList when it matched the search before the for loop exits but it does not print out every time when the if statements met the condition.</p>

<p>search = "ABC" <br/>
wordList = [["ABC", "123"], ["ABC", "456"], ["DEF", "123"]]</p>

<pre><code>public void biDi(String searchWord, String[][] wordList) {
    int start = 0; 
    int end = list.size ()-1;
    String search = searchWord;

    int path = 0;
    for (int i = 0; (i &lt; (list.size ()/2)); i++) {
        if (search == wordList[start][0]) {
            System.out.println (wordList[start][1]);
        }
        if (search == wordList[end][0]) {
            System.out.println (wordList[end][1]);
        }

        start++;
        end--;
        path++;
    }

    System.out.println (path);

}
</code></pre>
