import java.util.*;class GenericHashMap
{
HashMap<GenericHashMap, String> map; public void set(){
String str = "A sample string.";
getMap().put(this, str);
} public String get(GenericHashMap c){
if(c == null)
return getMap().get(this);
return getMap().get(c);
} private HashMap getMap(){
if(map == null){
map = new HashMap<GenericHashMap, String>();
return map;
}
return map;
}
}上面这个类编译不过, 中间的get方法里面没有强制转型???
我这不是用了泛型了吗?为什么还编译不过?