Create new Copy On Write Array Set - Java java.util

Java examples for java.util:Set Creation

Description

Create new Copy On Write Array Set

Demo Code


//package com.java2s;

import java.util.Collection;

import java.util.concurrent.CopyOnWriteArraySet;

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

    public static <E> CopyOnWriteArraySet<E> newCopyOnWriteArraySet() {
        return new CopyOnWriteArraySet<E>();
    }

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

Related Tutorials