Difference between abstract class and interface

Answers were Sorted based on User's Feedback



Difference between abstract class and interface..

Answer / mkm

)1. Accessibility modifier(Public/Private/internal) is
allowed for abstract class.
Interface doesn't allow accessibility modifier

2. class can inherit only one abstract class
class can implement more than one interface.

(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.
• Interface is used to "implements"; whereas abstract class
is used to "extends".
• Interface can be used to achieve multiple inheritance;
abstract class can be used as a single inheritance.

Is This Answer Correct ?    13 Yes 2 No

Difference between abstract class and interface..

Answer / venu

Abstract class and interface

Abstract class we can declare variables here,bt interface we
cannot,interface methods are by default is public,bt
abstract nt.
abstract we can declare object bt we cannot declare instants
of the class.bt interface we cannot do both.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

Caching techniques in .NET?

2 Answers   Microsoft,


I have developed a web application in asp.net 2.0 with Access as back end i am trying to gereate report/export data in excel. After hosting the site i am not getting any error or such exported excel file. but using the source code from my system it works fine. Could any one tell me why it is happening and what is its solution.

2 Answers  


Is it possible to use two versions of assembly at the same time?If possible explain with code?

3 Answers   Tech Mahindra,


What are the advantages of passport authentication?

0 Answers  


What is datagrid asp.net?

0 Answers  


What is indexing on asp.net?

0 Answers  


What is server side session management?

0 Answers  


How many types cache in asp net?

0 Answers  


Explain the difference between page.registerclientscriptblock and page.registerstartupscript?

0 Answers  


What is asp.net master page?

0 Answers  


i have one gridview contains edititemtemplate(which contains update and cancel buttons) and i have one item template (contains edit button) i want the code for update and cancelbuttons in edit item template and i want the code for edit button in itemtemplate. please help me

4 Answers  


What does aspcompat="true" mean?

0 Answers  


Categories