Interface only contains the signature of your logic. It must be implemented fully in your child class. We use "using" clause when we want to include namespace which is different then the namespace of your project, but if your class or interface is in the same namespace you don't need to use "using" clause.
You can inherit your child class with interfaces and make your code more flexible.
An example of it would be:
public interface IClown
{
string FunnyThingIHave { get; }
void Honk();
}
public class TallGuy : IClown
{
public string FunnyThingIHave {
get { return "big shoes"; }
}
public void Honk() {
MessageBox.Show("Honk honk!");
}
}
public class Joker:IClown
{
public string FunnyThingIHave
{
get {return "I have a clown car"}
}
public void Honk()
{
MessageBox.Show("Honk Bonk");
}
}
public class FunnyClowns
{
Joker joker = new Joker();
TallGuy tguy = new TallGuy();
string WhichFunnyThingIWant(IClown clownType)
{
clownType.Honk();
}
}
Now what this is doing is defining a clown interface and then defining two child classes for it then a third class can dynamically call the clowntype object of IClown. This is a simple example but this kind of logic can be applied in many other situations. That is where interfaces can be really helpful. I hope this helps..