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 difference between state server and sqlserver? : .NET Architecture

529


What is private constructor? And it's use?

632


How can we integrate atlas with web services?

519


Can you explain server controls in atlas?

530


Explain cache? : .NET Architecture

551






What is code access security (cas)?

562


Explain the types of memory management? : Dot net architecture

494


Explain the difference between l1 and l2 cache? : Dot net architecture

543


What are the five stages in a dlx pipeline? : Dot net architecture

509


What are the main Tools to develop .Net Application?

534


Can I customise the trace output?

626


How to improve the cache performance? : .NET Architecture

545


Explain 'managed' mean in the .NET context

688


Why am I getting an invalidoperationexception when I serialize an arraylist?

480


What are end points, contract, address and bindings?

517