Create new Linked Blocking Deque - Java java.util

Java examples for java.util:Collection Creation

Description

Create new Linked Blocking Deque

Demo Code


//package com.java2s;

import java.util.Collection;

import java.util.concurrent.LinkedBlockingDeque;

public class Main {
    public static void main(String[] argv) {
        System.out.println(newLinkedBlockingDeque());
    }//from  w ww .j a v a  2 s. c o  m

    public static <E> LinkedBlockingDeque<E> newLinkedBlockingDeque() {
        return new LinkedBlockingDeque<E>();
    }

    public static <E> LinkedBlockingDeque<E> newLinkedBlockingDeque(
            final Collection<? extends E> c) {
        return new LinkedBlockingDeque<E>(c);
    }

    public static <E> LinkedBlockingDeque<E> newLinkedBlockingDeque(
            final int initialCapacity) {
        return new LinkedBlockingDeque<E>(initialCapacity);
    }
}

Related Tutorials