title: Overloading a method: both methods have same erasure
body: <p>I have the following code and it doesn't work: the error <code>both methods have same erasure</code> appears.</p>
  
  <pre><code>public class Foo&lt;V&gt;  {
      public static void main(String[] args)  {
      }
  
      public void Bar(V value)  {
      }
  
      public void Bar(Object value)  {
      } 
  }
  </code></pre>
  
  <p>Also I have this code:</p>
  
  <pre><code>public class Foo&lt;V&gt;  {
      public static void main(String[] args)  {
      }
  
      public void Bar(B value)  {
      }
  
      public void Bar(A value)  {
      }
  }
  
  class A  {
  }
  
  class B extends A  {
  }
  </code></pre>
  
  <p>And this works. In the first case <code>V</code> is a child of <code>Object</code>, just like in the second case <code>B</code> is a child of <code>A</code>. Then why the first case results in error, while the second compiles successfully?</p>
  
  <p><strong>EDIT</strong>: What should I do to achieve method overloading, without raising an error?</p>