O'Reilly logo

OCP Java SE 7 Programmer II Certification Guide: Prepare for the 1ZO-804 exam by Mala Gupta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementations of the Deque interface

This section covers two main Deque implementations: ArrayDeque and LinkedList, as shown in figure 4.20.

Figure 4.20. The Deque interface and its implementations (on the exam)

Class ArrayDeque

Let’s get started with class ArrayDeque. It’s a resizable array implementation of the Deque interface. Here’s a list of constructors of this class:

Let’s work with an example using the ArrayDeque constructor and other methods from this class:

Here’s the output of the preceding code:

D4
A1
B2
[B2, C3, E5, F6]

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required