.
Abstraction
Abstraction is "the process of identifying common patterns that have systematic variations; an abstraction represents the common pattern and provides a means for specifying which variation to use" (Richard Gabriel).
An abstract class is a parent class that allows inheritance but can never be instantiated. Abstract classes contain one or more abstract methods that do not have implementation. Abstract classes allow specialization of inherited classes.
Polymorphism
Polymorphism allows objects to be represented in multiple forms. Even though classes are derived or inherited from the same parent class, each derived class will have its own behavior. Polymorphism is a concept linked to inheritance and assures that derived classes have the same functions even though each derived class performs different operations.
Virtual keyword
The virtual keyword allows polymorphism too. A virtual property or method has an implementation in the base class, and can be overriden in the derived classes.
To create a virtual member in C#, use the virtual keyword:
public virtual void Draw()
To create a virtual member in VB.NET, use the Overridable keyword:
Public Overridable Function Draw()
Override keyword
Overriding is the action of modifying or replacing the implementation of the parent class with a new one. Parent classes with virtual or abstract members allow derived classes to override them.
Solution for the QlikView, Biztalk, DotNet and MSBI real time development problems
Search This Blog
Monday, June 1, 2009
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Applies To ASP.NET version 1.1 ASP.NET version 2.0 Summary This How To shows how you can help protect your ASP.NET applications from cr...
-
Use below javascript function to 1) validate the date difference in asp.net 2) difference (number of days, months, years) between two dat...
-
Difference between C# var and Javascript var C# var i = 10; // implicitly typed int i = 10; //explicitly typed //Initialization is man...
-
Confirmation box from code behind c# using modalpopup ajax control <% @ Page Language ="C#" AutoEventWireup ="true...
-
function numbersonly(e) { var unicode = e.charCode ? e.charCode : e.keyCode if (unicode != 8) { //if the key isn't the backspace key (...
No comments:
Post a Comment