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());
    }/*  w  w w .  j a v  a 2  s.c om*/

    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