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

When does a session actually start?

0 Answers  


How does the XmlSerializer work? What ACL permissions does a process using it require?

2 Answers  


When during the page processing cycle is ViewState available?

1 Answers  


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

0 Answers  


What is a pixel url?

0 Answers  






what are webservices?In which circumstances we can go for webservices?

3 Answers   Microsoft,


What is application variable in asp.net?

0 Answers  


Define caching.

0 Answers  


Suppose You Want A Certain Asp.net Function Executed On Mouseover For A Certain Button. Where Do You Add An Event Handler?

0 Answers   Siebel Systems,


How to authenticate users using Web.Config ?

1 Answers   Accenture,


What is the difference between cache and cookies?

0 Answers  


Define ViewState and how can it be used?

6 Answers   Siebel,


Categories