What is the fastest way to convert a Queue
into a List
while keeping the Queue order?
Queue
To ArrayList
ConstructorThe easiest way to just create a ArrayList and pass your Queue as an argument in the constructor of ArrayList that takes a Collection. A Queue
is a Collection
, so that works.
This is the easiest way and I believe fastest way too.
List> list = new ArrayList<>( myQueue );