Difference between abstract class and interface
Answer Posted / ramani krunal
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 ? | 0 Yes | 1 No |
Post New Answer View All Answers
Differnce between managed code and unmanaged code ?
What is .net mobile input validation. Explain with an example? : Microsoft dot net mobile
Explain about cookie less session state? : .NET Architecture
How do we do authentications using atlas?
What is new in the .net 2.0 class library?
What is .net mobile automatic paging? : Microsoft dot net mobile
Explain dma? : .NET Architecture
Explain different pipelining hazards and how are they eliminated? : Dot net architecture
what are the fundamental and common properties of .net controls?
Are there any third party logging components available?
What are relation objects in dataset?
Does application frame need host?
I want to create a project like google maps how can we do that with atlas?
what is polymorphism and advantage ?
How does .net remoting work?