Bounded-wildcard related compiler error
问题 I am wondering what is wrong with this code: Map <? extends String, ? extends Integer> m = null; Set<Map.Entry<? extends String, ? extends Integer>> s = m.entrySet(); The compiler complains with the error message: Type mismatch: cannot convert from Set<Map.Entry<capture#1-of ? extends String,capture#2-of ? extends Integer>> to Set<Map.Entry<? extends String,? extends Integer>> What should the type of s be? Eclipse suggests Set<?> but I am trying to get more specific than that. 回答1: This issue