Difference between abstract class and interface

Answers were Sorted based on User's Feedback



Difference between abstract class and interface..

Answer / sumit gupta

the basic logical difference is you create abstract class when there is a relation between two classes that will inherit the abstract class and you create interface for the classes which are not related to each other but do have some common functionality.

below link describes it quite nicely.

http://devworkexperience.com/2011/09/interfaces-vs-abstract-classes/

Is This Answer Correct ?    1 Yes 1 No

Difference between abstract class and interface..

Answer / killer

An abstract class is a special kind of class It allow other
classes to inherit but cannot be instantiated. It Inherit
only one abstract class.

An interface is similar to Abstract class, it cannot use
override keyword in inheritance class. It inherits several
interfaces.

Is This Answer Correct ?    1 Yes 1 No

Difference between abstract class and interface..

Answer / arunachalam.m

To inherit the more than one interface class.... But in
abstract onle one abstract class can be inherit them....

Is This Answer Correct ?    1 Yes 1 No

Difference between abstract class and interface..

Answer / ravi anand pathak

1)-Abstract class required two key word for declaring
abstract class.
Interface required interface keyword for declaring the
interface.
2)-Within abstract class we can declare concrite and
abstract both type of method.
Interface support only abstract method.
3)-Variable declared within abstract class are normal.
All variables are emplicitly final,public static within
interface.
4)-We required abstract keyword to declared abstract
keyword.
All methods areemplicitlypublic and abstract.
5)-We use extends kyeword to inheriate any abstract class.
We use implements kyeword to use interfaces.
6)-Only one abstract class can extends at a time(single
inheritence).
We can use multipleinterface in a class at asame time(just
like multiple overriding).

Is This Answer Correct ?    0 Yes 0 No

Difference between abstract class and interface..

Answer / penchalaramaiah

An Abstract class have an implementation but an interface should not any implementation and it contains only definition
and interface contains by default abstract methods but an abstract class contains subclassess

Is This Answer Correct ?    0 Yes 0 No

Difference between abstract class and interface..

Answer / braham dutt

Abstract classes can have implementations for some of its
members (Methods), but the inteface class can't have
implementation for any of its members.

Abstract classes are faster than interfaces.
Interface comes in Inheritance chain while Abstract not.

Is This Answer Correct ?    0 Yes 0 No

Difference between abstract class and interface..

Answer / ramana

abstract class is about to have defined and undefined methods.but in case of interfaces ,only method declarations are avaliable.abstract class can't support multiple inheritance but interfaces can support.

Is This Answer Correct ?    0 Yes 0 No

Difference between abstract class and interface..

Answer / abi

In Abstract class we can do implementation for its methods
but in interface we can not do implemantations for any of
ti's methods

Is This Answer Correct ?    0 Yes 0 No

Difference between abstract class and interface..

Answer / malar

In Abstract class:We cant create the instance for abstract
class..
In Interface:It allow to create the instance through
implementing classes...

Is This Answer Correct ?    0 Yes 0 No

Difference between abstract class and interface..

Answer / ramani krunal

1. interface contains methods that must be abstract;
abstract class may contain concrete methods.
2. interface contains variables that must be static and
final; abstract class may contain non-final and final variables.
3. members in an interface are public by default,
abstract class may contain non-public members.
4. interface is used to "implements"; whereas abstract
class is used to "extends".
5. interface can be used to achieve multiple inheritance;
abstract class can be used as a single inheritance.
6. interface can "extends" another interface, abstract
class can "extends" another class and "implements" multiple
interfaces.
7. interface is absolutely abstract; abstract class can
be invoked if a main() exists.
8. interface is more flexible than abstract class because
one class can only "extends" one super class, but
"implements" multiple interfaces.
9. If given a choice, use interface instead of abstract
class.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Dot Net AllOther Interview Questions

What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?

2 Answers  


Explain about validation?

0 Answers  


Explain .net mobile selectionlist control? : Microsoft dot net mobile

0 Answers  


What should one do to make class serializable?

1 Answers  


What is the mesi? : .NET Architecture

0 Answers  






What is the mesi? : Dot net architecture

0 Answers  


What is different about namespace declaration when comparing that to package declaration in java?

0 Answers  


Explain write back and write through caches? : .NET Architecture

0 Answers  


Wcf- What is ABC

1 Answers   PCS,


how u maintain data while navigating one page to another?

2 Answers  


Explain about the base class library provided by microsoft.net?

0 Answers  


what is the difference between Exportdll and Importdll ?

1 Answers  


Categories