There is an error in the code saying cannot create a generic array of E. Could anyone help me in this thanks
    **Q = new E[N];**
Here is the full code;
package org.circular;
public class CircularArrayQueue<E> implements QueueADT<E> {
private static final int capacity = 5;
private E[] Q;
private final int N; // capacity
private int f = 0;
private int r = 0;
public CircularArrayQueue() {
    this(capacity);
}
public CircularArrayQueue(int capacity) {
    N = capacity;
    Q = new E[N];
}
public int size() {
    if (r > f)
        return r - f;
    return N - f + r;
}
public boolean isEmpty() {
    return (r == f) ? true : false;
}
public boolean isFull() {
    int diff = r - f;
    if (diff == -1 || diff == (N - 1))
        return true;
    return false;
}
public void enqueue(E element) throws FullQueueException {
    if (isFull()) {
        throw new FullQueueException("Full");
    } else {
        Q[r] = element;
        r = (r + 1) % N;
    }
}
public E dequeue() throws EmptyQueueException {
    E item;
    if (isEmpty()) {
        throw new EmptyQueueException("Empty");
    } else {
        item = Q[f];
        Q[f] = null;
        f = (f + 1) % N;
    }
    return item;
}
@Override
public E front() throws EmptyQueueException {
    if (isEmpty()) {
        throw new EmptyQueueException("Empty");
    }
    return null;
}
}
 
     
     
    