if else statement execution
<p>I am new to programming. When I run the code below, it executes only the if statement and prints only the "xmap". But my input has both 'x' and 'y' and so I want my program to crawl through every line and see if 'x' or'y' and print both. Can anyone help me with this.</p>

<pre><code>import java.io.*;
import java.util.*;

public class abc {

    public static void main(String[] args) {
        Map&lt;String, List&lt;String&gt;&gt; xMap = new HashMap&lt;String, List&lt;String&gt;&gt;();
        Map&lt;String, List&lt;String&gt;&gt; yMap = new HashMap&lt;String, List&lt;String&gt;&gt;();
        try {
            Scanner scanner = new Scanner(new FileReader("C:/"));

            while (scanner.hasNextLine()) {
                String nextLine = scanner.nextLine();
                String[] column = nextLine.split(":");
                if (column[0].equals("x")) {
                    if (column.length == 4) {
                        xMap.put(column[1], Arrays.asList(column[2], column[3]));
                    } else {
                        yMap.put(column[1], Arrays.asList(column[2], column[3]));
                    }
                }

            }
            scanner.close();

        }

        catch (Exception e) {

            e.printStackTrace();
        }
        System.out.println(xMap);
        System.out.println(yMap);
    }
}
</code></pre>
