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
Can you Explain
What is the use of web.config?
Define a virtual memory? : Dot net architecture
How does .net remoting work?
How cache coherency is eliminated? : Dot net architecture
Explain .net mobile input controls? : Microsoft dot net mobile
Explain the purpose of cache? How is it used? : .NET Architecture
What is the difference between an event and a delegate?
Explain the race around condition? : .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 biginteger and when would you use that?
Explain hard disk and what is its purpose? : Dot net architecture
Explain domestic architecture artifacts? : .NET Architecture
how to add list of items in a web application and win application?
12. Types of polymorphisem[Run and Design Exp.]