http://www.codeproject.com/Articles/11155/Abstract-Class-versus-Interface
Interface is not a class. Its an entity with word interface which provides a contract of methods without any implementation. Its is used only for inheritance
++++++++++++++++++
http://msdn.microsoft.com/en-us/library/9w2ctx1s%28v=vs.71%29.aspx
An interface describes the methods, properties, and events that a class needs to implement, and the type of parameters each member needs to receive and return, but leaves the specific implementation of these members up to the implementing class.
An abstract class is a class that cannot be instantiated itself; it must be inherited. Some or all members of the class might be unimplemented, and it is up to the inheriting class to provide that implementation. Members that are implemented might still be overridden, and the inheriting class can still implement additional interfaces or other functionality
Polymorphism is the ability for classes to provide different implementations of methods that are called by the same name.
You may also wish to use inheritance when your application design includes several related classes that must share identical implementation for certain common functions. The overlapping functionality can be implemented in a base class, from which the classes used in the application can be derived. An abstract class combines features of both inheritance and implementation, and may be useful when elements of each are needed.
Interface is not a class. Its an entity with word interface which provides a contract of methods without any implementation. Its is used only for inheritance
++++++++++++++++++
http://msdn.microsoft.com/en-us/library/9w2ctx1s%28v=vs.71%29.aspx
An interface describes the methods, properties, and events that a class needs to implement, and the type of parameters each member needs to receive and return, but leaves the specific implementation of these members up to the implementing class.
An abstract class is a class that cannot be instantiated itself; it must be inherited. Some or all members of the class might be unimplemented, and it is up to the inheriting class to provide that implementation. Members that are implemented might still be overridden, and the inheriting class can still implement additional interfaces or other functionality
Polymorphism is the ability for classes to provide different implementations of methods that are called by the same name.
When to Use Inheritance-Driven Polymorphism
The foremost use of inheritance is to add functionality to an existing base class. Programmer productivity is much greater when you start with a framework of fully debugged base classes, and methods can be incrementally added to base classes without breaking versioning.You may also wish to use inheritance when your application design includes several related classes that must share identical implementation for certain common functions. The overlapping functionality can be implemented in a base class, from which the classes used in the application can be derived. An abstract class combines features of both inheritance and implementation, and may be useful when elements of each are needed.
No comments:
Post a Comment