In the book
OCP_ Oracle Certified Professional Java SE 8 Programmer II Study Guide_ Exam
The authors provide a table containing some methods of
ArrayDequeue :
Method | Description | For queue | For stack |
---|
boolean add(E e) | Adds an element to.... | Yes | No |
---|
... | ... | ... | ... |
---|
What I don't understand is this :
for queue and
for stack
I think that we could define an ArrayDequeue with a stack or a queue as:
//1
however when I tried to use the 1st declaration the code did not compile