What will happen when you compile and run the following code snippet?

import java.util.*;
public class X
{
    public static void main(final String[] args)
    {
        final ArrayList al = new ArrayList();
        al.add("string1");
        al.add("string2");
        al.add("string3");
        int j = 0;
        for (Iterator i = al.iterator(); i.hasNext(); ++j)
        {
            if (i.next() == "string1")
            {
                al.remove(j);
            }
        }
        System.out.println(al.size());
    }
}

A) Compiler error.
B) Throw an exception at runtime.
C) Output: 0
D) Output: 2
E) Output: 3