Click here to Skip to main content
15,895,833 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want a clear explanation about that difference and where it can be used in projects.
Posted
Updated 31-May-14 2:10am
v2
Comments
[no name] 31-May-14 7:12am    
What exactly was unclear or confusing about the documentation that you found when you conducted your research prior to posting this?
Richard MacCutchan 31-May-14 7:40am    
Ha ha, best joke I've seen this week.
george4986 31-May-14 8:15am    
consider u have an erp project on which u have added dlls for modules like hr,payroll,inventory,...so on. U can use interface class to pass data(eg:user name,login company,location..) between forms in the dlls. Each forms u need to inherit the interface class ,set properties,constructor.From calling form create object of interface class and pass values.

The difference is simple:
An interface is not a class, and cannot be instantiated. It cannot contain any concrete code, only abstract definitions. You can inherit an Interface as well as a single base class, provided you complete the "contract" and implement the methods and properties it requires.

An abstract class is different: you still can't instantiate it - which means you can't say
C#
MyAbstractBase mab = new MyAbstractBase();
but if you derive from an abstract class you cannot derive from any other class at the same time. An abstract class can contain concrete code, which will be used if it isn't overridden in the derived class.

This is a fairly complicated subject, and you should really start with a C# tutorial for the details: http://csharp.net-tutorials.com/classes/interfaces/[^] is a good basis.
 
Share this answer
 
v2
you can refer to this site here each and every term is clearly explained check-out

Difference between abstract classes and interfaces [^]
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900