when we need interface c#
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/240152/why-would-i-want-to-use-interfaces">Why would I want to use Interfaces?</a>
  <a href="http://stackoverflow.com/questions/9451868/why-i-need-interface">Why I need Interface?</a>  </p>
</blockquote>



<p>I want to know where and when to use it?</p>

<p>For example,</p>

<pre><code>interface IDemo
{
 // Function prototype
 public void Show();
}

// First class using the interface
class MyClass1 : IDemo
{
 public void show()
 {
  // Function body comes here
  Response.Write("I'm in MyClass");
 } 
}

// Second class using the interface
class MyClass2 : IDemo
{
 public void show() 
 {
  // Function body comes here
  Response.Write("I'm in MyClass2");
  Response.Write("So, what?");
 }
</code></pre>

<p>These two classes has the same function name with different body.
This can be even achieved without Interface.
Then why we need an Interface where and when to use it?  </p>
