《有些模式》- 类型推导
public class Temp {public static void main(String[] args) {//第一种方式HashMap<String, Double> hmap = new HashMap<String, Double>();//类型推导方式HashMap<String, Double> hmap2=Temp.newInstance();}public static <K, V> HashMap<K, V> newInstance() {return new HashMap<K, V>();}}
?