Skip to content

Commit c1f62da

Browse files
committed
initialize a new array of type E[]
1 parent 9719fdd commit c1f62da

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/queue/usingArray/ArrayQueue.java

+1
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,6 @@ public E peek() {
124124
@SuppressWarnings("unchecked")
125125
private void reallocate() {
126126
int newCapacity = 2 * capacity;
127+
E[] newData = (E[]) new Object[newCapacity];
127128
}
128129
}

0 commit comments

Comments
 (0)