stsanz
asked on
Explain Interfaces
I am currently learning C#. I know C++ quite well, and a few of Java.
I thought a C# 'interface' was similar to an 'abstract' class when I suddenly discovered that there exists two independant keywords to declare classes : 'interface' and 'abstract'.
I don't really understand the notion of 'contract' in the definition of an interface.
Please explain C# interfaces, in what situation they should be used, and how they differ from abstract classes.
I thought a C# 'interface' was similar to an 'abstract' class when I suddenly discovered that there exists two independant keywords to declare classes : 'interface' and 'abstract'.
I don't really understand the notion of 'contract' in the definition of an interface.
Please explain C# interfaces, in what situation they should be used, and how they differ from abstract classes.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks!
Last, I advice you to look at this URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconAbstractClassesVersusInterfaces.asp