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 page fragment caching?

631


Why do you use the app_code folder in asp.net?

636


Which .NET framework supports Web API?

682


1.how to encrpt query string in asp.net? 2.there are 10000 records then i wnat display 5000 records one gridview and 5000 records another grid view what is the process?

1788


What is custom attribute? How to create?

634






What is a 1x1 pixel?

623


What is application session?

588


Explain how can we inherit a static variable?

620


Explain about the .NET framework?

688


How ViewstateMac works?

2457


Explain the difference between debug.write and trace.write? When should each be used?

652


How many types of cookies are there in asp.net?

622


Which is better session or viewstate?

590


Which of the following .NET framework supports Web API?

733


How can we Validate a Controls in ASP.NET page using JavaScript?

721