title: The type parameter E is hiding the type E. Generics template to a class
body: <p>I am practicing generics and i did the following.</p>
  <p>Created a class called man as below.</p>
  <pre class="lang-java prettyprint-override"><code>public class Man{
      int hands=2;
      int legs=2;
      boolean alive;
      
      public Man(boolean b) {
          // TODO Auto-generated constructor stub
          alive=b;
      }
  }
  </code></pre>
  <p>created a class called person</p>
  <pre class="lang-java prettyprint-override"><code>public class Person&lt;Man&gt; {
      Man p;
      String name;
      
  
      public Person(Man p, String name) {
          this.p = p;
          this.name = name;
      }
      public Person() {
          // TODO Auto-generated constructor stub
      }
  
  }
  </code></pre>
  <p>tried to instantiate a person of type string or int as below and it doesn't throw an error.</p>
  <pre><code>Person&lt;String&gt; p1 = new Person&lt;String&gt;(new String(&quot;test&quot;), &quot;test1&quot;);
      Person&lt;Integer&gt; p2=new Person&lt;&gt;(1,&quot;test&quot;);
  </code></pre>
  <p>when i checked carefully, i got the following warning. &quot;The type parameter Man is hiding the type Man&quot;</p>
  <p>So i understand that giving Man as a type parameter to the class Person is as good as giving 'E' in java examples. Its not Man.class. Why did this happen?
  How do i assign my Man.class as the generic type parameter?</p>
  <p>and can you throw me some good questions/practice exercises to learn generics.</p>