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
deference between display and visibility property of CSS
what is tracing? Where it used?
how to use custom field validation
What is password attribute of the textbox control of .net mobile? : Microsoft dot net mobile
Explain cache? : .NET Architecture
What are the major differences between services and web services?
What are the types of memory management? : Dot net architecture
Whate are resource files? How are they used in .net?
What is Object Caching in Visual Studio 2010?
Explain .net mobile input controls? : Microsoft dot net mobile
What is gui programming? : .NET Architecture
What is the numeric attribute of the textbox control in .net mobile? : Microsoft dot net mobile
What is MS chart control in visual studio?
Explain some of the disadvantages due to microsoft.net?
Can I create my own context attributes?