Java ArrayBlockingQueue toString() Method

The toString() method of Java ArrayBlockingQueue returns a string representation of this collection.

Syntax:

Parameters:

NA

Overrides

Return Value:

The toString() method returns a string representation of this collection.

Example 1

Output:

Elements in queue : [Reema, Rahul, Rita, Ramesh]

Example 2

Output:

[Name = Hinna, Name = Vinni, Name = Rima]