Java ArrayBlockingQueue toString() Method

7 Jan 2025 | 1 min read

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]