Can't convert type int to E using Java generics
<p>Been doing well with Java until generics. I'm having a hard time converting this queue to use generics that will accept any data type. </p>

<p>I don't understand why <code>item</code> cant be converted to <code>int</code> when <code>item</code> should represent "any" data type. </p>

<p>An answer plus a little explanation on generics would be useful, as I need to create a remove function as well. </p>

<pre><code>private int initialCapacity = 10;
private int size = 0;
private int[] content;

public static &lt;E&gt; void add(E item) {
    int size = 0;
    int[] content;

    // If we run out of space in the array
    if (size == content.length) {

        // 1) Create a new, larger array (2x)
        int[] newArray = new int[content.length * 2];

        // 2) Copy the content from the old array to the new one
        for (int c = 0; c &lt; content.length; c++) {
            newArray[c] = content[c];
        }

        // 3) Let the old array point to the new array
        content = newArray;
    }

    //Add the item to the content of the array list
    content[size] = item;
    size++;
}
</code></pre>