public class People {
class Family extends People {
}
}
public class Together {
private static ConcurrentMap<String, Collection<Family>> familyMap= new ConcurrentHashMap<String, Collection<Family>>();
private static ConcurrentMap<String, ConcurrentMap<String, Collection<People>>> registry2 = new ConcurrentHashMap<String, ConcurrentMap<String, Collection<People>>>();
static {
registry2.put(Family.class.toString(), familyMap);
}
}
(私はすでに宣言registry2
をhavingに変更しようとしました? extends People
エラーは次のとおりです。
The method put(String, ConcurrentMap<String,Collection<People>>) in the type Map<String,ConcurrentMap<String,Collection<People>>> is not applicable for the arguments (String, ConcurrentMap<String,Collection<Family>>)
どうすればハッシュマップにfamilyMap
入れることができますか?registry2