Java generics: required capture#67 of? -


I have this function:

  / ** * The helper function adds the value of For the elements of BKA, * Treating all the keys that are present in B but not in one, as in value 0 exists. NB: * It operates IN PLACE. * @ Ultimate A {@link java.util.Map} will retain the result * @ PRAMB {@link java.util.Map}, which will be a * / private static zero zodiac map (map and lieutenant??, Integer & gt; ; A, Maps & lt;?, Integer & gt; B) {Object of: b.keySet ()) {integer currentcount = A.G.T. (Key); A.put (key, currentCount == null.bget (key): presentcount + b.get (key)); However, for the NetBeans, the "key" is highlighted in the last line, and gives me this error:  
  put the method in the java.util class .map & lt; Kashmir, V & gt; Expected can not be applied to the given types: Capture # 67 ?, found java.lang.Integer: java.lang.Object, int  

(Installing the Internet The reason is not a problem, I also tried to use intrigues, but it did not work).

Specify "?" For the key it means that it can be of any kind, but for this method to work, the key should be the same for each map. Then use the following instead:

  Private static & lt; K & gt; Zero Zodiac map (Map of Lieutenant; K, Intex> A, Map & lt; K, Integer> B) Key: (B.Kacet ()) {Integer CurrentCount = A.G.T. (Key); A.put (key, currentCount == null.bget (key): presentcount + b.get (key)); }}  

Comments