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


Please Help Members By Posting Answers For Below Questions

What other than biginteger has been introduced in system.numerics namespace?

729


Xmlserializer is throwing a generic "there was an error reflecting myclass" error. How do I find out what the problem is?

738


What is an interrupt? : Dot net architecture

706


Explain the difference between state server and sqlserver : Dot net architecture

643


What is the difference between .net mobile pages and ordinary .net web page? : Microsoft dot net mobile

705


Whate are resource files? How are they used in .net?

667


What is .net mobile lists. Explain with an example? : Microsoft dot net mobile

674


Define pipelining? : Dot net architecture

787


Explain .net mobile automatic paging? : Microsoft dot net mobile

673


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

2093


Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture

667


Can you explain scriptmanager control?

724


Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form.

707


Explain difference between machine config vs. Web config : Dot net architecture

666


5. Wcf- Session Managment

1731