oops
explain difference b/w interface and abstraction classes?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Gurunatha DogiPosted Jul 16, 2014, 4:22 PM
http://www.onlinebuff.com/article_abstract-class-and-abstract-method-with-an-example-using-c_7.html
To understand interface in c# check the link below
http://www.onlinebuff.com/article_implementing-interface-in-c-with-an-example_18.html
Differences in provided in the both articles
Jignesh TrivediPosted Dec 23, 2013, 12:27 AM
hi,
Please refer
http://www.codeproject.com/Articles/11155/Abstract-Class-versus-Interface
http://www.c-sharpcorner.com/uploadfile/prasoonk/abstract-class-vs-interface/
http://msdn.microsoft.com/en-us/library/scsyfw1d(v=vs.71).aspx
hope this will help you.
Nipun TomarPosted Dec 22, 2013, 11:13 PM
Abstract Class:
a) An abstract class is a special kind of class that cannot be instantiated.
b) It allows the other classes to inherit from it but cannot be instantiated.
c) It is used to carry the same hierarchy or standards for all the subclasses.
Interface:
a) An interface is not a class,but it is an entity and has no implementation.
b) It has only the definition of the methods without the body.
Differences:
1) A class may inherit several interfaces, but inherit only one abstract class.
2) An abstract class can provide complete code, but interface provides just the signature.
3) An abstract class can contain access modifiers for the subs, functions, properties, but an interface cannot.
4) An abstract class defines the core identity of a class, but interfaces are used to define the peripheral abilities of a class.
5) An abstract class is fast whereas the interfaces requires more time to find the actual method in the corresponding classes.
6) If we add a new method to an abstract class, there we can provide the default implementation and therefore all the existing code might work properly whereas in interface, we have to track down all the implementations of the interface and define implementation for the new method.
7) In Interface, we cannot define the fields whereas in an Abstract class, we can define the fields and constants.
Read this: http://www.aspdotnet-suresh.com/2010/04/abstract-versus-interface.html
http://blog.ploeh.dk/2010/12/02/Interfacesarenotabstractions/
Thanks