title: What is the difference between ? and Object in Java generics?
body: <p>I'm using Eclipse to help me clean up some code to use Java generics properly.  Most of the time it's doing an excellent job of inferring types, but there are some cases where the inferred type has to be as generic as possible: Object.  But Eclipse seems to be giving me an option to choose between a type of Object and a type of '?'.</p>
  
  <p>So what's the difference between:</p>
  
  <pre><code>HashMap&lt;String, ?&gt; hash1;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>HashMap&lt;String, Object&gt; hash2;
  </code></pre>