title: Generics Object assignment in java
body: <p>I am getting compilation error for following code . ? means accepts any type of thing we assigned. I have Object type  and passes Object type. But I am getting compilation error why ?</p>
  
  <pre><code>NavigableSet&lt;?&gt; set = new TreeSet&lt;Object&gt;();
  set.add(new Object());
  </code></pre>