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

Explain is development of a mobile web application with asp.net is very easy? : Microsoft dot net mobile

521


How do I write to the application configuration file at runtime?

530


How will you do windows authentication and what is the namespace?

544


Session State and can i store desirialized object in state server, if yes how and if not why.

1352


What is the numeric attribute of the textbox control in .net mobile? : Microsoft dot net mobile

541






What is textbox control of .net mobile? : Microsoft dot net mobile

622


Explain hard disk? : Dot net architecture

581


Explain the purpose of cache? How is it used? : .NET Architecture

548


What is an asssembly qualified name? Is it a filename? How is it different?

512


Explain the use of virtual, sealed, override, and abstract.

575


What is the difference between primary & secondary storage device? : Dot net architecture

534


What size is a .net object?

635


what is polymorphism and advantage ?

1525


How can implement drag and drop using atlas?

572


What happens when you try to update data in a dataset in .net while the record is already deleted in sql server as backend?

519