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 difference between machine config vs. Web config : Dot net architecture
What is code access security (cas)?
What actually happes when you add a something to arraylistcollection ?
Difference between type constructor and instance constructor?
Explain the types of memory management? : .NET Architecture
Is dim fs as filestreamobject is a managed code? : Dot net architecture
Can I create my own permission set?
What happens when you try to update data in a dataset in .net while the record is already deleted in sql server as backend?
difference between data reader and dataset
Explain 'managed' mean in the .NET context
The maximum report processing jobs limit configured by your system administrator has been reached.How I can Solve this problem when i using crystal report to load from my application.
How to prevent my .NET DLL to be decompiled?
How to improve the cache performance? : .NET Architecture
What are the types of memory management? : Dot net architecture
Explain the difference between state server and sqlserver : Dot net architecture