Create new Delay Queue - Java java.util

Java examples for java.util:Collection Creation

Description

Create new Delay Queue

Demo Code


//package com.java2s;

import java.util.Collection;

import java.util.concurrent.DelayQueue;
import java.util.concurrent.Delayed;

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

    public static <E extends Delayed> DelayQueue<E> newDelayQueue() {
        return new DelayQueue<E>();
    }

    public static <E extends Delayed> DelayQueue<E> newDelayQueue(
            final Collection<? extends E> c) {
        return new DelayQueue<E>(c);
    }
}

Related Tutorials