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

Explain different pipelining hazards and how are they eliminated? : .NET Architecture

707


Explain cache? : .NET Architecture

733


So what exactly is the configuration file for then?

712


difference between Response.write,server.transfer and also which one is used when ?

1649


What is the difference between an application and a program?

679


What are end points, contract, address and bindings?

701


What is difference between .net and visual studio?

708


How to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile

692


Explain write back and write through caches? : Dot net architecture

747


What are the major differences between services and web services?

696


How to upload in video,mp4,in .net 4.5 ..?

725


Explain about cookie less session state? : .NET Architecture

739


What is .net mobile automatic paging? : Microsoft dot net mobile

762


Can I customise the trace output?

829


HttpHendler and HttpModules

1896