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

What is simple data binding?

0 Answers  


what is the difference between this.controls and page.form1.controls and me.controls?

2 Answers   FactorH,


What does the orientation property do in a menu control?

0 Answers  


What is Fragment Caching in ASP.NET?

2 Answers   MCN Solutions, pspl, Wipro,


which is the new version of IIS SERVER

1 Answers  






What Name space does the web page belon in the .net framework class hierarchy?

1 Answers   L&T, Wipro,


What are the Types of chaching. How to implement caching

0 Answers   Microsoft,


How does a web application session work?

0 Answers  


Types of optimization and name a few and how do u do?

1 Answers   Accenture,


what is PostBack Property exactly ? when It Returns True? when it Returns False?

1 Answers  


I need some questions regarding asp.net for 1.5yrs of Experience.

1 Answers  


What is .net framework and what are the main components of it?

0 Answers  


Categories