title: TreeMap<?,?> cannot be converted to TreeMap<String,Double>?
body: <p>I am practicing with TreeMap in java and I am stucked in a situation where I have to use TreeMap constructor, I am not able to find any way dealing with it, I am writing the part of program here, can anyone help me out with this?
  what should this function return and how do I deal with </p>
  <p>Error: java.util.TreeMap&lt;capture#1 of ?,capture#2 of ?&gt; cannot be converted to java.util.TreeMap&lt;java.lang.String,java.lang.Double&gt;</p>
  <pre><code>   public TreeMap&lt;?,?&gt; createMatchesMap(String cricketDataset)
      {
             
          TreeMap&lt;String,Double&gt; tm = new TreeMap&lt;String,Double&gt;();
                 String[] str = cricketDataset.split(&quot;\\|&quot;);
                 for(int i=0;i&lt;str.length;i++) {
                     String[] str1 = str[i].split(&quot;,&quot;);
                     Double c = 0.0;
                     int c1=0;
                     if(str1[0].equals(&quot;1&quot;)) {
                         
                     for(int j=0;j&lt;str.length;j++) {
                         String[] str2 = str[j].split(&quot;,&quot;);
                         if(str2[1].equals(str1[1]) &amp;&amp; str2[0].equals(&quot;1&quot;)) {
                             Double score = Double.parseDouble(str2[2]);
                             c=c+score;
                             c1+=1;
                         }
                     }
                     tm.put(str1[1],c/c1);
                     }
                 }
              return tm;
     }
  </code></pre>