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 does assemblyinfo.cs file consist of?

2 Answers   Accenture, HCL,


What is a gridview in asp.net?

0 Answers  


how to retrieve property settings from xml .config file.

0 Answers  


Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default ?

0 Answers   DELL,


What the use of Form Authentication and windows Authentication?

1 Answers   NetCity, TCS,






Webconfig file is cofiguration of server or browser?

10 Answers   Wipro,


can u debug application programatically? if yes how?

0 Answers   FactorH,


Can I read the hard disk serial # of the client computer using asp.net?

0 Answers  


How to add DateTime Control in normal DataGrid Server Control?

0 Answers  


Tell about WebService in Asp.Net?

5 Answers   Accenture, CTS,


What is a WebService and what is the underlying protocol used in it? Namespace?

1 Answers  


In which event of the page life cycle, is the viewstate available?

0 Answers  


Categories