/**
* 容器初始化工具类
* @author xiangfeishao
*
*/
public class ContainerInstanceUtils {
/**
* 获取HashMap对象实例
* @return
*/
public static <K, V> Map<K, V> map() {
return new HashMap<K, V>();
}
/**
* 获取ArrayList对象实例
* @return
*/
public static <T> List<T> list() {
return new ArrayList<T>();
}
/**
* 获取LinkedList对象实例
* @return
*/
public static <T> LinkedList<T> lList() {
return new LinkedList<T>();
}
/**
* 获取HashSet对象实例
* @return
*/
public static <T> Set<T> set() {
return new HashSet<T>();
}
}
java 泛型 小应用 工具类
最新推荐文章于 2024-04-30 21:48:46 发布