The .size()
method returns the number of elements in the queue.
Syntax
The .size()
method is called on a queue using the following syntax:
queueName.size();
Codebyte Example
The codebyte example below uses the .size()
method on the pizzas
queue:
Code Output