Difference between abstract class and interface

Answer Posted / karthick

Unlike interfaces, abstract classes can contain fields that
are not static and final, and they can contain implemented
methods. Such abstract classes are similar to interfaces,
except that they provide a partial implementation, leaving
it to subclasses to complete the implementation. If an
abstract class contains only abstract method declarations,
it should be declared as an interface instead.

Multiple interfaces can be implemented by classes anywhere
in the class hierarchy, whether or not they are related to
one another in any way. Think of Comparable or Cloneable,
for example.

By comparison, abstract classes are most commonly subclassed
to share pieces of implementation. A single abstract class
is subclassed by similar classes that have a lot in common
(the implemented parts of the abstract class), but also have
some differences (the abstract methods).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a service contract, operation contract and data contract?

535


How can I create a application?

521


Use of Enable view state ? if turn off what happen ?

3818


What is the mesi? : .NET Architecture

607


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

547






What actually happes when you add a something to arraylistcollection ?

492


Explain is development of a mobile web application with asp.net is very easy? : Microsoft dot net mobile

521


what is sessions and cookies take one example simple way to understand

1860


Define an interrupt? : Dot net architecture

555


What is textbox control of .net mobile? : Microsoft dot net mobile

622


What is Object Caching in Visual Studio 2010?

604


Explain about microsoft visual studio?

556


how to change row background color in gridview

563


4. Wcf- what Asych and Sych call and how that works

1448


Explain Singleton design pattern in .net

579