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
How can we perform data binding in atlas?
Define the mesi? : Dot net architecture
Define cache coherency and how is it eliminated? : Dot net architecture
What is difference between .net and visual studio?
What is the use of TPL DATAFLOW?
Explain Singleton design pattern in .net
Explain the purpose of cache? : Dot net architecture
.Net Frame work arch?
Explain about cookie less session state? : .NET Architecture
What is new in the .net 2.0 class library?
12. Types of polymorphisem[Run and Design Exp.]
What is the importance of updatepanel control?
How cache coherency is eliminated? : Dot net architecture
What is .net mobile utility controls. : Microsoft dot net mobile
What is .net mobile input validation. : Microsoft dot net mobile