.Net Framework, Asp.net, Ado.net, .Net Remoting, .Net Webservice, SQL, XML, XSLT, WCF, WPF, WWF NHibernate, Ajax, Jquery, DHTML

Ado.netAsp.Net 2.0SQLC-SharpXMLFrameworkIISXMLWebServiceArchitecture
UMLProject ManagementSDLCMethodologiesDesign PatterenOOPWCF.Net RemotingWWF
MVPMVCSilver LightN-HibernateAjaxJ-QuerySEO-MarketingSite MapPhp

Object Oriented Programming

Four core concept of OOP Object Oriented Programming. 1.Inheritance, 2.Polymorphism, 3.Abstraction and 4.Encapsulation

Access Modifier in C#

Encapsulation : Encapsulation is process of keeping data and methods together inside objects.
Encapsulation Sample
1:namespace Arindam
2:{
3: public class EtgEncapsulation
4: {
5:
6:
7: protected int _height;
8: protected int _width;
9: private int _thickness;
10:
11: public EtgEncapsulation(int thickness)
12: {
13: this._thickness = thickness;
14: }
15:
16:
17: public int GetVolume()
18: {
19:
20: int volume = this._height * this._width * this._thickness;
21: if (volume < 0)
22: return 0;
23: return volume;
24:
25: }
26:
27:
28: }
29:}
30:

Polymorphism : In simple word Polymorphism is the process of multiple implementation of single defination. let's look at the code below
Polymorphism Sample
namespace Arindam
1:{
2: public class EtgDeclaration
3: {
4: public virtual void Country()
5: {
6: Console.WriteLine("Here is my country name");
7: }
8: }
9:
10: public class EtgPolymorphism : EtgDeclaration
11: {
12:
13: public override void Out()
14: {
15: Console.WriteLine("India, A great country");
16: }
17:
18: }
19:}
20:

Inheritance : Inheritance is the process of creation new classes from already existing classes. The inheritance feature that allows us to reuse some parts of code of base class.
Inheritance Sample
namespace Arindam
1:{
2:
3: public class Country
4: {
5: public string Name;
6: public double Temperature;
7:
8: }
9:
10: /* here i can use the all public members of base class.*/
11: public class India : Country
12: {
13: void ShowInfo()
14: {
15: this.Name = "India";
16: this.Temperature = 25.3;
17: }
18: }
19:}
20:

Abstraction : "Abstraction" refers to the act of representing essential features without including the background details or explanations. Classes use the concept of abstraction and are defined as a list of abstract attributes.
Abstraction Sample
namespace Arindam
1:{
2: public abstract class MyAbstraction
3: {
4:
5: public abstract string GetName { get; set; }
6: }
7:
8:
9:}
10:
Sponsored by

Privacy Policy ©2009 ETG Consultancy, All Rights Reserved Terms & Conditions
Asp.net, Ado.net, .Net Remoting, .Net Webservice, SQL, XML, XSLT, WCF, WPF, WWF NHibernate, Ajax, Jquery, DHTML