Difference between abstract class and interface
Answer Posted / arjunrao
(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.
| Is This Answer Correct ? | 591 Yes | 61 No |
Post New Answer View All Answers
Explain about appdomains?
What is msil, and why should my developers need an appreciation of it if at all?
Explain cache? : .NET Architecture
What do you know about machine.config file ?
Explain write back and write through caches? : Dot net architecture
i wish to write mcts(microsoft certified technology specialist) exam. can anyone give the model question or format and preparation method?
Explain how cache is used? : Dot net architecture
Describe the Managed Execution Process in .NET?
Explain difference between machine config vs. Web config : Dot net architecture
What is .net viewstate?
Why am I getting an invalidoperationexception when I serialize an arraylist?
Explain different pipelining hazards and how are they eliminated? : .NET Architecture
What is .net mobile input validation. Explain with an example? : Microsoft dot net mobile
What is new in the .net 2.0 class library?
What's the difference between an application and a program?