Difference between abstract class and interface
Answer Posted / rajneesh hajela
ABSTRACT CLASS:
1) we can't create object of abstract class.
2) we can declare a variable.
3) we can make normal method and abstract method.
4) we can't make method body with abstract method.
5) in derived class we can use abstract method by override
keyword.
6) we can't use multiple inheritance in abstract class.
7) Absrtact class can be extended by only one class;
Interface can be implemented by more than one class;
ie. class can inherit only one abstract class
8)Abstract classes can inherit interfaces while interfaces
cannot inherit abstract classes
but class can implement more than one interface.
9) The members of the interface are public with no
implementation. Abstract classes can have protected
parts,static methods, etc.
10)An abstract class can contain fields,
constructors, or destructors and implement properties. An
interface can not contain fields, constructors, or
destructors and it has abstractmethod,property's signature
but no implementation etc.
Rajneesh Hajela
Gwalior(M.P.)
| Is This Answer Correct ? | 52 Yes | 11 No |
Post New Answer View All Answers
Explain .net mobile input controls? : Microsoft dot net mobile
What is the difference between l1 and l2 cache? : Dot net architecture
Explain about generation?
How cache is used? : Dot net architecture
if there are two application 1 and 2 having a variable x in both app if client1 changes value of x in 1 app client 2 want reads the value of x from 2 app what resultant value will he get
Explain different pipelining hazards? : Dot net architecture
How can I write my own .NET host?
What is an interrupt? : .NET Architecture
What is Video Streaming in .net??
Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture
What does this do? Gacutil /l | find /i "corillian"
When do I need to use gc.keepalive?
What happens when you try to update data in a dataset in .net while the record is already deleted in sql server as backend?
Why am I getting an invalidoperationexception when I serialize an arraylist?
Explain the race around condition? : Dot net architecture