Generics and Abstract class
<p>I have implemented Generices as following:  </p>

<pre><code>  public class GenericAnimal&lt;T&gt; 
  {
    public int legs;
    public void Walk()
    {
        Console.WriteLine("Animals Walk....");
    }
}

public class Dog 
{
    public void Bark()
    {
        Console.WriteLine("Barking....");
    }
}

public class Cat 
{
    public void Mew()
    {
        Console.WriteLine("Mewing....");
    }
}
</code></pre>

<p>Then I am using the class as following:</p>

<pre><code>        GenericAnimal&lt;Dog&gt; dogObj = new GenericAnimal&lt;Dog&gt;();
        GenericAnimal&lt;Cat&gt; catObj = new GenericAnimal&lt;Cat&gt;(); 
</code></pre>

<p>In both the dogObj and catObj, I am getting the "Walk" method. This thing I can do using  abstract class. Then what is the added advantage of using Generics over Abstract class?</p>
