Difference between abstract class and interface

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between cache and session?

684


What are ASP.NET Web Forms? How is this technology different than what is available though ASP?

1235


How response object is related to asp's response object?

690


What are sessions in asp net?

731


Explain why datareader is useful?

747


What are different types of authentication techniques that are used in connection strings to connect .net applications with microsoft sql server?

722


How do you remove duplicates without using remove duplicate stage?

787


What are the types of validation in asp net?

731


What is the difference between system.stringbuilder and system.string

464


How do you change the session time-out value?

770


Explain the boxing and unboxing concept in .net?

584


How to improve performance of web application asp.net mvc? : Asp.Net MVC

718


Can you explain one critical mapping? Performance issue which one is better?

661


What do you understand by aggregate dependency?

793


Do you know caching feature?

737