Why will my remove function find strings but not ints? : <p>We are working on generics which requires us to have an array of AnyType (the driver implements an array of strings then integers). One of the functions is a boolean function called 'remove' which finds 'x' and removes it, then it returns true. It has no issues finding and removing a string but can't seem to find ints. Why is this?</p>

<p>the code is</p>

<pre><code>public boolean remove(AnyType x)
{
    for(int i = 0; i &lt; length; i++)
    {
        if(arr[i] == x)
        {
            for(int j = i; j &lt; length - 1; j++)
            {
                arr[j] = arr[j + 1];
            }
            length--;
            return true;
        }
    }
    return false;
}
</code></pre>
