(1) An abstract class may contain complete or incomplete methods. Interfaces can contain only the
signature of a method but no body. Thus an abstract class can implement methods but an interface can not implement methods.
(2) An abstract class can contain fields, constructors, or destructors and implement properties. An
interface can not contain fields, constructors, or destructors and it has only the property's signature but no
implementation.
(3) An abstract class cannot support multiple inheritance, but an interface can support multiple
inheritance. Thus a class may inherit several interfaces but only one abstract class.
(4) A class implementing an interface has to implement all the methods of the interface, but the same is
not required in the case of an abstract Class.
(5) Various access modifiers such as abstract, protected, internal, public, virtual, etc. are useful in
abstract Classes but not in interfaces.
(6) Abstract classes are faster than interfaces.
(7) Abstract class is must inheritable & its scope is upto derived class
(8) Interface is must implementable & its scope is upto any level of its inheritence chain.
Build Your Own Test Framework
-
[image: Build Your Own Test Framework]
Learn to write better automated tests that will dramatically increase your
productivity and have fun while doing so...
2 hours ago
No comments:
Post a Comment
I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.