Microsoft SDK for Java

Queue Class Constructors

The Queue Class contains the following constructors:

Queue()
Queue(int initialcapacity)
Queue(int initialcapacity, int growthfactor)

Queue()

Constructs a queue with an initial capacity of 32 elements. When the queue is full, its size doubles.

Syntax

public Queue();

Queue(int initialcapacity)

Constructs a queue with the given initial capacity. When the queue is full, the capacity doubles in size.

Syntax

public Queue(int initialcapacity);

Parameters

initialcapacity The size of the queue to construct (the number of elements it will hold).

Queue(int initialcapacity, int growthfactor)

Constructs a queue with the given initial capacity and growth factor.

Syntax

public Queue(int initialcapacity, int growthfactor);

Parameters

initialcapacity The initial size of the queue.
growthfactor The factor to grow by when the queue is full. If the growth factor is 1, the queue will drop elements at its head as needed.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.