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
What other than biginteger has been introduced in system.numerics namespace?
Xmlserializer is throwing a generic "there was an error reflecting myclass" error. How do I find out what the problem is?
What is an interrupt? : Dot net architecture
Explain the difference between state server and sqlserver : Dot net architecture
What is the difference between .net mobile pages and ordinary .net web page? : Microsoft dot net mobile
Whate are resource files? How are they used in .net?
What is .net mobile lists. Explain with an example? : Microsoft dot net mobile
Define pipelining? : Dot net architecture
Explain .net mobile automatic paging? : Microsoft dot net mobile
if there are two application 1 and 2 having a variable x in both app if client1 changes value of x in 1 app client 2 want reads the value of x from 2 app what resultant value will he get
Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture
Can you explain scriptmanager control?
Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form.
Explain difference between machine config vs. Web config : Dot net architecture
5. Wcf- Session Managment