Click here to Skip to main content
15,895,786 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
Explain Real Scenario Where we use Abstract class and interface
Posted

Hi,
I am going to describe some samples of their usage:
1- Interface : You need to inherit a class from multiple entities rather than one. As C# does not support the first one, You need to inherit from interfaces and only one class:
C#
public class Test: Iinterface1, Iinterface2,class1

2- Interfaces are used in Web Services and WCF Services
3- Interfaces can not be implemented so they are just signatures to enforce hierarchies to implement a signature
4- Abstract classes are base classes(if implemented ) to let the hierarchy to have some functionality and may implement some of them themselves.

I hope it will help,
Cheers
 
Share this answer
 
 
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