Array implementation of Java Stack
Suppressing warnings

It's hard to defend suppressing warnings at the class level.
The problematic lines in your code are these:


    data = (T[]) new Object[INITIAL_CAPACITY];



Which appears in two places.
I suggest to move the array allocation to one place,
and suppress the warning only for that line, like this:

public ArrayStack() {
    data = newArray(INITIAL_CAPACITY);
}

private final T[] newArray(int capacity) {
    @SuppressWarnings("unchecked")
    T[] tmp = (T[]) new Object[capacity];
    return tmp;
}

private void enlarge() {
    T[] temp = Arrays.copyOf(data, data.length);
    data = newArray(data.length * 2);

    System.arraycopy(temp, 0, data, 0, temp.length);
}


This hits two birds with one stone:


The ugly array creation is now at once place instead of two
Warnings are suppressed for the single problematic line, not for the entire class


In case you were wondering, the local tmp variable is necessary in newArray, otherwise Java doesn't allow suppressing the warning on a return statement or regular assignment. It has to be declaration + assignment.

Another important note here is the private final modifier of newArray.
The private modifier is necessary to prevent sub-classes from overriding the behavior and potentially breaking the constructor.
The final modifier is necessary to prevent sub-classes from shadowing the method by another method with the same name, causing confusion.

Manual array copy

Instead of this:


for (int i = 0; i &lt; temp.length; i++) {
    data[i] = temp[i];
}



It's better to use System.arraycopy instead:

System.arraycopy(temp, 0, data, 0, temp.length);


(Also seen in the previous section.)

Other minor things

In clear, I'm wondering why you manually null out the elements,
rather than simply creating a fresh new array.
You could let the garbage collector take care of the stale array.

Random is unused, so remove the import.