容器创建工具类

来源:互联网 发布:哪里帮人做网络推广 编辑:程序博客网 时间:2024/05/16 11:28
import java.util.*;public class New {    public static <K,V> Map<K,V> map(){        return new HashMap<K,V>();    }    public static <T> List<T> list(){        return new ArrayList<T>();    }    public static <T> LinkedList<T> lList(){        return new LinkedList<T>();    }    public static <T> Set<T> set(){        return new HashSet<T>();    }    public static <T> Queue<T> queue(){        return new LinkedList<T>();    }}
0 0
原创粉丝点击