Example usage for java.util.concurrent ArrayBlockingQueue toString

List of usage examples for java.util.concurrent ArrayBlockingQueue toString

Introduction

In this page you can find the example usage for java.util.concurrent ArrayBlockingQueue toString.

Prototype

public String toString() 

Source Link

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    int capacity = 10;
    ArrayBlockingQueue<Integer> queue = new ArrayBlockingQueue<Integer>(capacity);

    for (int i = 0; i < 10; i++) {
        queue.add(i);//from  w w w .  java  2  s . c o  m
    }

    System.out.println(queue.toString());
}