Java examples for java.util:List Operation
Write code to Add a varargs list of items into a set.
//package com.java2s; import java.util.Set; public class Main { public static final <T, U extends T> Set<T> addToSet(Set<T> set, U... items) {//from w w w . j av a 2s. c o m if (set != null && items != null) { for (int i = 0; i < items.length; i++) { set.add(items[i]); } } return set; } }