I'm having trouble with a java error specifically, this one:
arrayqueue.ArrayQueue is not abstract and does not override abstract method dequeue() in arrayqueue.Queue at arrayqueue.ArrayQueue.(ArrayQueue.java:11)
Here's the code the error is occurring in:
public class ArrayQueue<E> implements Queue<E> {
E [] Q;
int f,r;
int size;
static final int CAPACITY = 1000;
int capacity;
public ArrayQueue() {
this(CAPACITY);
}
public ArrayQueue(int cap){
capacity = cap;
Q = (E []) new Object[capacity];
f = 0;
r = 0;
size = 0;
}
public static void main(String[] args) {
}
}
Line 11 would be this line: public class ArrayQueue<E> implements Queue<E> {
Specifically, I don't understand what the <E>
in this line means. I'm trying to implement the queue ADT using a circular array. Obviously this implements the Queue interface, which I also don't understand the concept of an interface quite yet (Why can't Java be like Python!?)
For reference, I've also posted the Queue interface below:
public interface Queue<F> {
public int size();
public boolean isEmpty();
public F front() throws EmptyQueueException;
public void enqueue(F element);
public F dequeue() throws EmptyQueueException;
}
I know this is about 5 questions in a row, but conceptually, this is confusing to me. I appreciate any help.