Interviews1 answer
What is the difference between an Interface and an Abstract Class in C#?
1 Answer
Hi Sahil,
Interface
1. There are only abstract methods in interface.
2. Methods can only be declared and cannot be implemented in interface
3. Cannot create variables
4. The class that extends interface will implement the methods
5. It allows you to have multiple inheritance
6. Cannot use access specifiers
Abstract Class
1. Can have both concrete and abstract methods
2. Can create variables
3. Can declare and implement methods
4. Doesn't allow multiple inheritance
5. Can use access specifiers
Thanks,
Sandeep
Sandeep NeelaPosted Feb 26, 2016, 6:57 AM EST