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 are the things we generally declare in session_start , application_start ?

2 Answers  


What actually happes when you add a something to arraylistcollection ?

0 Answers  


So what exactly is the configuration file for then?

0 Answers  


The maximum report processing jobs limit configured by your system administrator has been reached.How I can Solve this problem when i using crystal report to load from my application.

2 Answers  


2. What type of code (server or client) is found in a Code-Behind class?

1 Answers  






Explain about httpruntime.cach.get(); method?

0 Answers   Tech Mahindra,


What is cache coherency and how is it eliminated? : Dot net architecture

0 Answers  


Explain Intermediate Language?

0 Answers   MaxSolPro,


What is the main Difference Between .Net 2003 and .Net 2005.and also Asp1.1,Asp2.0 and Asp3.0

4 Answers   Satyam, TCS,


How to delete the duplicate records from table(having bulk records)?

4 Answers   BV, iGate,


Can you Explain <mobile:link> element .net mobile with example? : Microsoft dot net mobile

0 Answers  


Explain the purpose of cache? How is it used? : Dot net architecture

0 Answers  


Categories