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 is the mesi? : Dot net architecture
Explain the use of virtual, sealed, override, and abstract.
Explain how to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile
Explain the Lapsed Listener problem in .net
How to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile
Describe the advantages of writing a managed code application instead of unmanaged one. What is involved in certain piece of code being managed?
12. Types of polymorphisem[Run and Design Exp.]
define cache memory? : Dot net architecture
Explain cache? : .NET Architecture
if there are two application 1 and 2 having a variable x in both app if client1 changes value of x in 1 app client 2 want reads the value of x from 2 app what resultant value will he get
Can you explain atlasuiglitz library?
What is an interrupt? : .NET Architecture
Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form.
What is the use of web.config?
Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form. What is the exact procedure. : Dot net architecture