Create new Concurrent Linked Queue - Java java.util

Java examples for java.util:Collection Creation

Description

Create new Concurrent Linked Queue

Demo Code


//package com.java2s;

import java.util.Collection;

import java.util.concurrent.ConcurrentLinkedQueue;

public class Main {
    public static void main(String[] argv) {
        System.out.println(newConcurrentLinkedQueue());
    }//  www .j  a  v  a2 s.com

    public static <E> ConcurrentLinkedQueue<E> newConcurrentLinkedQueue() {
        return new ConcurrentLinkedQueue<E>();
    }

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

Related Tutorials