Difference between abstract class and interface
Answer Posted / aloka
INTERFACE:
1)a class can implement any number of interfaces.
2)variables declared in interfaces are by default final
3)members on interfaces are public by default
4)should be implemented using keyword "implements"
5)absolutely abstract and cannot be instantiated.
6)requires more time to find the actual method in the
corresponding class
7) if we add a new method to an interface, then we have to
track down all implementations of interface and define
implementation of the new method.
ABSTRACT CLASS:
1)a class can inherit only one abstract class
2)may contain non-final variables
3)members can be declared with any access specifier
4)should be inherited using "extends" keyword
5)cannot be instantiated but can be invoked if main() exists
6)faster than interfaces
7)if we add a new method to abstract class, then we've the
option of providing default implementation and therefore all
existing code might work properly.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Explain what does the term "green architecture" mean? : Dot net architecture
Can you explain server controls in atlas?
How is the using() pattern useful? What is idisposable?
difference between data reader and dataset
Differnce between managed code and unmanaged code ?
12. Types of polymorphisem[Run and Design Exp.]
Whats new features in Visual Studio 2012?
.Net Frame work arch?
What is an interrupt? : Dot net architecture
Name some changes done since version 3.0?
How do I know when my thread pool work item has completed?
What are the important principles of soa (service oriented architecture)?
What is a service contract, operation contract and data contract?
What is a clickonce application?
What is textview control of .net mobile? : Microsoft dot net mobile