Difference between abstract class and interface
Answer Posted / vikash kumar
1. interface contains methods that must be abstract;
abstract class may contain concrete methods.
2. interface contains variables that must be static and
final; abstract class may contain non-final and final variables.
3. members in an interface are public by default,
abstract class may contain non-public members.
4. interface is used to "implements"; whereas abstract
class is used to "extends".
5. interface can be used to achieve multiple inheritance;
abstract class can be used as a single inheritance.
6. interface can "extends" another interface, abstract
class can "extends" another class and "implements" multiple
interfaces.
7. interface is absolutely abstract; abstract class can
be invoked if a main() exists.
8. interface is more flexible than abstract class because
one class can only "extends" one super class, but
"implements" multiple interfaces.
9. If given a choice, use interface instead of abstract
class.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain difference between machine config vs. Web config? : .NET Architecture
What is textbox control of .net mobile? : Microsoft dot net mobile
Explain about appdomains?
What is the difference between l1 and l2 cache? : Dot net architecture
State the different levels of exceptional safety?
what is inheritancy where u required ?
Explain the difference between primary & secondary storage device? : Dot net architecture
how to change the title of my window?
Explain 'managed' mean in the .NET context
What does this do? Gacutil /l | find /i "corillian"
Explain hard disk and what is its purpose? : .NET Architecture
can u give me real example of how web.config overrides the machine.config file?
The maximum report processing jobs limit configured by your system administrator has been reached.How I can Solve this problem when i using crystal report to load from my application.
Explain about microsoft visual studio?
how we can fire event in databound column in datagrid without using button?