Object Oriented Concept


Mechanism to hide or protect certain group of data and code using special kind of wrapper is called encapsulation. Class is one of the primary object use to wrap the variable, data, methods and properties … Also protect members from unwanted or unauthorized interaction.

public class encapsulationBase


private string privateMember = "Private Member accessible within the class.";

protected string protectedMember = "Protected Member available in derived class.";

public string publicProperty { get; set; }

internal string internalBaseMethod()


return privateMember + "Internal Member available within assembly file." ;




Mechanism of the object with certain functionality handle many different type of values is called polymorphism. Generic methods and interfaces are type independent, those are best example for the polymorphism.

using System.Collections.Generic;




List<int> intPolymorphismList = new List<int>();

List<double> doublePolymorphismList = new List<double>();

List<string> stringPolymorphismList = new List<string>();


Mechanism to using properties of one object from another object in hierarchical order is called inheritance. Derived class acquires base class accessible members is the best example for this concept.

public class encapsulationDerived : encapsulationBase


public string showBaseProtectedMember()


return protectedMember;// this protected member inherit from base class


internal string internalDerivedMethod()


return internalBaseMethod(); // this internal method derived from base class




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s