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
What are library functions?
What is .net mobile input validation. : Microsoft dot net mobile
difference between data reader and dataset
What are public and private assemblies ?
Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture
How resource files are used in .net?
What is WPF and WCF?
I can't be bothered with cas. Can I turn it off?
Define cache? : Dot net architecture
What is the cli? Is it the same as the clr?
What is cache coherency? : Dot net architecture
Explain domestic architecture artifacts? : .NET Architecture
Can you explain server controls in atlas?
What are the new features of .net 2.0?
Explain the race around condition? : Dot net architecture