introduction to object oriented programming concepts (oops)

26
Follow Follow @aspdo @aspdo 'red Fresh Yellow Logo Men''s Casual Rs. 499 Black Grey Melange Red - Pack Of 3 Rs. 699 'red White Logo Men''s Casual Tee' Rs. 499 Grey Black And White Crew Neck T-shirts - Rs. 699 ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies HOME ASP.NET AJAX GRIDVIEW JAVASCRIPT SQL JQUERY OOPS CONCEPTS INTERVIEW QUESTIONS TRACE MOBILE NUMBER CONTACT Introduction to Object Oriented Programming Concepts (OOPS) in C#.net By: Suresh Dasari Apr 16, 2010 Categories: OOPS Concepts OOPS Concepts Class: It is a collection of objects. Object: It is a real time entity. An object can be considered a " thing" that can perform a set of related activities. The set of activities that the object performs defines the object's behavior. For example, the hand can grip something or a Student (object) can give the name or address. In pure OOP terms an object is an instance of a class The above template describe about object Student Class is composed of three things name, attributes, and operations public class student { } student objstudent= new student (); According to the above sample we can say that Student object, named objstudent, has created out of the student class. In real world you will often find many individual objects all of the same kind. As an example, there may be thousands of other bicycles in existence, all of the same make and model. Each bicycle has built from the same blueprint. In object-oriented terms, we say that the bicycle is an instance of the class of objects known as bicycles. In the software world, though you may not have realized it, you have already used classes. For example, the Textbox control, you always used, is made out of the Textbox class, which defines its appearance and capabilities. Each time you drag a Textbox control, you are actually creating a new instance of the Textbox class. Encapsulation: Encapsulation is a process of binding the data members and member functions into a single unit. Example for encapsulation is class. A class can contain data structures and methods. Consider the following class public class Aperture { public Aperture () { } protected double height; protected double width; protected double thickness; Search This Site Search About Me SURESHDASARI TENALI, ANDHRA PRADESH, INDIA Hi i am suresh dasari,software engineer working on asp.net,c#.net,SQL Server. VIEWMY COMPLETE PROFILE jQuery Back Butto Select Language Powered by Translate Recent Posts Like 5.3k Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013 http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 1 / 26

Upload: sandeep-varmas

Post on 12-Nov-2014

131 views

Category:

Documents


6 download

DESCRIPTION

oops c#

TRANSCRIPT

Page 1: Introduction to Object Oriented Programming Concepts (OOPS)

Follow Follow @aspdotnetsuresh@aspdotnetsuresh

'red FreshYellow LogoMen''s Casual

Rs. 499

Black GreyMelange Red -

Pack Of 3

Rs. 699

'red White LogoMen''s Casual

Tee'

Rs. 499

Grey Black AndWhite Crew

Neck T-shirts -

Rs. 699

ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQLServer,Ajax,SSRS, XML examplesaspdotnet-suresh offers C#.net articles andtutorials,csharp dot net,asp.net articles andtutorials,VB.NET Articles,Gridview articles,codeexamples of asp.net 2.0 /3.5,AJAX,SQL ServerArticles,examples of .net technologies

HOME ASP.NET AJAX GRIDVIEW JAVASCRIPT SQL JQUERY OOPS CONCEPTS INTERVIEW QUESTIONS TRACE MOBILE NUMBER CONTACT

Introduction to Object Oriented Programming Concepts (OOPS) inC#.netBy: Suresh Dasari Apr 16, 2010Categories: OOPS Concepts

OOPS Concepts

Class:

It is a collection of objects.

Object:

It is a real time entity.An object can be considered a "thing" that can perform a set of related activities. The set of activitiesthat the object performs defines the object's behavior. For example, the hand can grip something or aStudent (object) can give the name or address. In pure OOP terms an object is an instance of a class

The above template describe about object StudentClass is composed of three things name, attributes, and operations

public class student{}student objstudent=new student ();

According to the above sample we can say that Student object, named objstudent, has created out ofthe student class.

In real world you will often find many individual objects all of the same kind. As an example, there may bethousands of other bicycles in existence, all of the same make and model. Each bicycle has built from thesame blueprint. In object-oriented terms, we say that the bicycle is an instance of the class of objectsknown as bicycles. In the software world, though you may not have realized it, you have already usedclasses. For example, the Textbox control, you always used, is made out of the Textbox class, whichdefines its appearance and capabilities. Each time you drag a Textbox control, you are actually creatinga new instance of the Textbox class.

Encapsulation:

Encapsulation is a process of binding the data members and member functions into a single unit.

Example for encapsulation is class. A class can contain data structures and methods.Consider the following class

public class Aperture{public Aperture (){}protected double height;protected double width;protected double thickness;

Search This Site

Search

About Me

SURESH DASARITENALI, ANDHRA PRADESH, INDIA

Hi i am suresh dasari,software

engineer working on

asp.net,c#.net,SQL Server.

VIEW MY COMPLETE PROFILE

jQuery Back Button | Go Back to Previous Page in jQuery

Select Language

Powered by Translate

Recent Posts

Like 5.3k

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 1 / 26

Page 2: Introduction to Object Oriented Programming Concepts (OOPS)

protected double thickness;public double get volume(){Double volume=height * width * thickness;if (volume<0)return 0;return volume;}}

In this example we encapsulate some data such as height, width, thickness and method Get Volume.Other methods or objects can interact with this object through methods that have public access modifier

Abstraction:

Abstraction is a process of hiding the implementation details and displaying the essential features.

Example1: A Laptop consists of many things such as processor, motherboard, RAM, keyboard, LCDscreen, wireless antenna, web camera, usb ports, battery, speakers etc. To use it, you don't need toknow how internally LCD screens, keyboard, web camera, battery, wireless antenna, speaker’s works. You just need to know how to operate the laptop by switching it on. Think about if you would have to callto the engineer who knows all internal details of the laptop before operating it. This would have highlyexpensive as well as not easy to use everywhere by everyone.

So here the Laptop is an object that is designed to hide its complexity.How to abstract: - By using Access Specifiers

.Net has five access Specifiers

Public -- Accessible outside the class through object reference.

Private -- Accessible inside the class only through member functions.

Protected -- Just like private but Accessible in derived classes also through member functions.

Internal -- Visible inside the assembly. Accessible through objects.

Protected Internal -- Visible inside the assembly through objects and in derived classes outside theassembly through member functions.

Let’s try to understand by a practical example:-

public class Class1 { int i; //No Access specifier means private public int j; // Public protected int k; //Protected data internal int m; // Internal means visible inside assembly protected internal int n; //inside assembly as well as to derived classes outsideassembly static int x; // This is also private public static int y; //Static means shared across objects [DllImport("MyDll.dll")] public static extern int MyFoo(); //extern means declared in this assembly defined in someother assembly public void myFoo2() { //Within a class if you create an object of same class then you can access all data membersthrough object reference even private data too Class1 obj = new Class1(); obj.i =10; //Error can’t access private data through object.But here it is accessible.:) obj.j =10; obj.k=10; obj.m=10; obj.n=10; // obj.s =10; //Errror Static data can be accessed by class names only Class1.x = 10; // obj.y = 10; //Errror Static data can be accessed by class names only Class1.y = 10; } }

Now lets try to copy the same code inside Main method and try to compile[STAThread]

46

46

We're on

+533

Follow

Get Latest articles in your inbox for free.

Enter your email address:

Subscribe

TweetTweet

Categories

Asp.net ( 414 )General ( 267 )JQuery ( 182 )

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 2 / 26

Page 3: Introduction to Object Oriented Programming Concepts (OOPS)

static void Main() { //Access specifiers comes into picture only when you create object of class outside the class Class1 obj = new Class1(); // obj.i =10; //Error can’t access private data through object. obj.j =10; // obj.k=10; //Error can’t access protected data through object. obj.m=10; obj.n=10; // obj.s =10; //Errror Static data can be accessed by class names only Class1.x = 10; //Error can’t access private data outside class // obj.y = 10; //Errror Static data can be accessed by class names only Class1.y = 10; }What if Main is inside another assembly[STAThread] static void Main() { //Access specifiers comes into picture only when you create object of class outside the class Class1 obj = new Class1(); // obj.i =10; //Error can’t access private data through object. obj.j =10; // obj.k=10; //Error can’t access protected data through object. // obj.m=10; // Error can’t access internal data outside assembly // obj.n=10; // Error can’t access internal data outside assembly

// obj.s =10; //Errror Static data can be accessed by class names only Class1.x = 10; //Error can’t access private data outside class // obj.y = 10; //Errror Static data can be accessed by class names only Class1.y = 10; }In object-oriented software, complexity is managed by using abstraction.Abstraction is a process that involves identifying the critical behavior of an object and eliminatingirrelevant and complex details.

Inheritance:

Inheritance is a process of deriving the new class from already existing classC# is a complete object oriented programming language. Inheritance is one of the primary concepts ofobject-oriented programming. It allows you to reuse existing code. Through effective use of inheritance,you can save lot of time in your programming and also reduce errors, which in turn will increase the qualityof work and productivity. A simple example to understand inheritance in C#.

Using System;Public class BaseClass{ Public BaseClass () { Console.WriteLine ("Base Class Constructor executed"); } Public void Write () { Console.WriteLine ("Write method in Base Class executed"); }} Public class ChildClass: BaseClass{ Public ChildClass () { Console.WriteLine("Child Class Constructor executed"); } Public static void Main () { ChildClass CC = new ChildClass (); CC.Write (); }}

In the Main () method in ChildClass we create an instance of childclass. Then we call the write () method.If you observe the ChildClass does not have a write() method in it. This write () method has been

Code Snippets ( 92 )SQL Server ( 82 )Javascript ( 78 )Gridview ( 73 )C#.Net ( 63 )VB.NET ( 51 )JQuery Plugins ( 41 )Errors ( 36 )Ajax ( 31 )Interview Questions ( 30 )DropdownList ( 18 )DatePicker ( 15 )Fileupload ( 15 )SharePoint ( 15 )validations ( 15 )Authentication ( 14 )Membership ( 14 )Google API ( 12 )IISServer ( 12 )Crystal Reports ( 11 )JSON ( 11 )CSS ( 10 )Google MAPS ( 10 )SendMail ( 8 )AutoComplete ( 7 )ExcelSheet ( 7 )InternetTips ( 7 )AjaxModalPopupExtender ( 6 )Menu ( 6 )SQL Joins ( 6 )SlideShow ( 6 )ToolTip ( 6 )Windows Application ( 6 )XML ( 6 )DataList ( 5 )ExportGridviewData ( 5 )Modalpopup ( 5 )WebService ( 5 )CheckBox ( 4 )Dynamic Controls ( 4 )Facebook ( 4 )Twitter ( 4 )WCF ( 4 )Windows Service ( 4 )YouTube ( 4 )jQuery Menu ( 4 )jQuery UI ( 4 )Accordion Menu ( 3 )AjaxAsyncFileUpload ( 3 )EncryptionandDecryption ( 3 )LightBoxEffect ( 3 )OOPS Concepts ( 3 )Visual Studio ( 3 )ZIP UNZIP Files ( 3 )web.config ( 3 )AjaxAutoCompleteExtender ( 2 )AjaxTabContainer ( 2 )Blog Statistics ( 2 )Flip Effect ( 2 )Global.asax ( 2 )MultilineTextbox ( 2 )News Ticker in jQuery ( 2 )Progressbar ( 2 )SSRS ( 2 )Session Timeout ( 2 )ThumbnailsGeneration ( 2 )UserName Check ( 2 )3-TierArchitecture ( 1 )ADO.NET ( 1 )AbstractVsInterface ( 1 )ActiveDirectory ( 1 )Advertise ( 1 )Ajax Calendarextender ( 1 )Ajax ConfirmbuttonExtender ( 1 )

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 3 / 26

Page 4: Introduction to Object Oriented Programming Concepts (OOPS)

If you observe the ChildClass does not have a write() method in it. This write () method has beeninherited from the parent BaseClass.

The output of the above program is

Output: Base Class Constructor executed Child Class Constructor executed Write method in Base Class executed

this output proves that when we create an instance of a child class, the base class constructor willautomatically be called before the child class constructor. So in general Base classes are automaticallyinstantiated before derived classes.

In C# the syntax for specifying BaseClass and ChildClass relationship is shown below. The base class isspecified by adding a colon, ":", after the derived class identifier and then specifying the base class name.

Syntax: class ChildClassName: BaseClass { //Body }

C# supports single class inheritance only. What this means is, your class can inherit from only one baseclass at a time. In the code snippet below, class C is trying to inherit from Class A and B at the sametime. This is not allowed in C#. This will lead to a compile time error: Class 'C' cannot have multiple base classes: 'A' and 'B'.

public class A{}public class B{}public class C : A, B{}

In C# Multi-Level inheritance is possible. Code snippet below demonstrates mlti-level inheritance. Class Bis derived from Class A. Class C is derived from Class B. So class C, will have access to all memberspresent in both Class A and Class B. As a result of multi-level inheritance Class has access toA_Method(),B_Method() and C_Method().

Note: Classes can inherit from multiple interfaces at the same time. Interview Question: How can youimplement multiple inheritance in C#? Ans : Using Interfaces. We will talk about interfaces in our laterarticle.

Using System;Public class A{ Public void A_Method () { Console.WriteLine ("Class A Method Called"); }}Public class B: A{ Public void B_Method () { Console.WriteLine ("Class A Method Called"); }}Public class C: B{ Public void C_Method () { Console.WriteLine ("Class A Method Called"); } Public static void Main () { C C1 = new C (); C1.A_Method (); C1.B_Method (); C1.C_Method (); }

AjaxAccordionControl ( 1 )AjaxCalendarExtender ( 1 )AjaxCollapsiblePanelControl ( 1 )AjaxDragPanelExtender ( 1 )AjaxPasswordStrength ( 1 )AjaxRatingControl ( 1 )AjaxSlideshowExtender ( 1 )Arraylist ( 1 )Assembly ( 1 )Authorization ( 1 )Average rating ( 1 )Chatting Plugins ( 1 )CheckBoxList ( 1 )CodingStandards ( 1 )Custom Right Click Menu ( 1 )DataGrid ( 1 )Fixed Header on Scroll ( 1 )Generic List ( 1 )HTML ( 1 )IP Address ( 1 )ImportContacts ( 1 )KeyBoard Key Codes ( 1 )ListBox ( 1 )MCC Award ( 1 )PDF Viewers ( 1 )QueryString ( 1 )RSSFeeds ( 1 )RadioButtonList ( 1 )Read/Write text file ( 1 )ReadOnlyValues ( 1 )Repeater ( 1 )Resize Image ( 1 )RichTextBox ( 1 )SQL Constraints ( 1 )SiteMap ( 1 )Social Media Bookmark Plugins ( 1 )Spell Checker ( 1 )Testing ( 1 )Trace Mobile Number ( 1 )Try Catch ( 1 )UpdatePanel ( 1 )VBScript ( 1 )Virtual Keyboard ( 1 )WPF ( 1 )scroll top/bottom of div ( 1 )setInterval ( 1 )

Blog Archive

► 2013 ( 137 )► 2012 ( 301 )► 2011 ( 131 )▼ 2010 ( 77 )

► December ( 20 )► November ( 5 )► October ( 11 )► September ( 14 )► August ( 8 )► July ( 1 )► June ( 2 )► May ( 4 )▼ April ( 12 )

C# Coding Standards and Best ProgrammingPractices...

How to Merger the two datatbles into onetable in ...

Introduction to Object Oriented ProgrammingConcep...

Set Color of GridLines in GridviewSetting up your ASP.NET server (IIS)Changing the Color of Selected item in menu

using ...Detect Browser Refresh to avoid events fired

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 4 / 26

Page 5: Introduction to Object Oriented Programming Concepts (OOPS)

}When you derive a class from a base class, the derived class will inherit all members of the base classexcept constructors. In the code snippet below class B will inherit both M1 and M2 from Class A, but youcannot access M2 because of the private access modifier. Class members declared with a private accessmodifier can be accessed only with in the class. We will talk about access modifiers in our later article.

Common Interview Question: Are private class members inherited to the derived class?

Ans: Yes, the private members are also inherited in the derived class but we will not be able to accessthem. Trying to access a private base class member in the derived class will report a compile time error.

Using System;Public class A{Public void M1 (){}Private void M2 (){}}

Public class B: A{Public static void Main (){B B1 = new B ();B1.M1 ();//Error, Cannot access private member M2//B1.M2 ();}}Method Hiding and Inheritance We will look at an example of how to hide a method in C#. The Parentclass has a write () method which is available to the child class. In the child class I have created a newwrite () method. So, now if I create an instance of child class and call the write () method, the child classwrite () method will be called. The child class is hiding the base class write () method. This is calledmethod hiding.

If we want to call the parent class write () method, we would have to type cast the child object toParent type and then call the write () method as shown in the code snippet below.

Using System;Public class Parent{ Public void Write () { Console.WriteLine ("Parent Class write method"); }} Public class Child: Parent{ Public new void Write () { Console.WriteLine ("Child Class write method"); } Public static void Main () { Child C1 = new Child (); C1.Write (); //Type caste C1 to be of type Parent and call Write () method ((Parent) C1).Write (); }}

Polymorphism:

When a message can be processed in different ways is called polymorphism. Polymorphism means manyforms. Polymorphism is one of the fundamental concepts of OOP.

again...Generating Random Number and String in C# or

Gener...C# - Difference between Abstract class and

Interfa...Maintaining State of CheckBoxes While Paging in

a ...how to Create RSS feed Using Asp.net | RSS

Feed S...how to import Contacts from GMAIL using

ASP.NET an...

Tags

Asp.net General JQuery Code SnippetsSQL Server Javascript Gridv iew C#.Net VB.NETJQuery Plugins E r ro rs A j a x Interview Quest ionsDro p d o w nL ist Da t e P ic k e r F ile u p lo ad SharePointvalidat ions Authent icat ion Membership Google APIIISServer Crystal Reports J S O N C S S Google MAPS

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 5 / 26

Page 6: Introduction to Object Oriented Programming Concepts (OOPS)

Polymorphism provides following features:

It allows you to invoke methods of derived class through base class reference during runtime.It has the ability for classes to provide different implementations of methods that are calledthrough the same name.

Polymorphism is of two types: 1. Compile time polymorphism/Overloading2. Runtime polymorphism/Overriding

Compile Time Polymorphism Compile time polymorphism is method and operators overloading. It is also called early binding. In method overloading method performs the different task at the different input parameters. Runtime Time Polymorphism Runtime time polymorphism is done using inheritance and virtual functions. Method overriding is calledruntime polymorphism. It is also called late binding. When overriding a method, you change the behavior of the method for the derived class. Overloadinga method simply involves having another method with the same prototype. Caution: Don't confused method overloading with method overriding, they are different, unrelatedconcepts. But they sound similar. Method overloading has nothing to do with inheritance or virtual methods. Following are examples of methods having different overloads: void area(int side);void area(int l, int b);void area(float radius); Practical example of Method Overloading (Compile Time Polymorphism) using System; namespace method_overloading{ class Program { public class Print { public void display(string name) { Console.WriteLine ("Your name is : " + name); } public void display(int age, float marks) { Console.WriteLine ("Your age is : " + age); Console.WriteLine ("Your marks are :" + marks); } } static void Main(string[] args) { Print obj = new Print (); obj.display ("George"); obj.display (34, 76.50f); Console.ReadLine (); } }}

Note: In the code if you observe display method is called two times. Display method will work according tothe number of parameters and type of parameters.

When and why to use method overloading

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 6 / 26

Page 7: Introduction to Object Oriented Programming Concepts (OOPS)

Use method overloading in situation where you want a class to be able to do something, but there is morethan one possibility for what information is supplied to the method that carries out the task. You should consider overloading a method when you for some reason need a couple of methods that takedifferent parameters, but conceptually do the same thing. Method overloading showing many forms. using System; namespace method_overloading_polymorphism{ Class Program { Public class Shape { Public void Area (float r) { float a = (float)3.14 * r; // here we have used function overload with 1 parameter. Console.WriteLine ("Area of a circle: {0}",a); } Public void Area(float l, float b) { float x = (float)l* b; // here we have used function overload with 2 parameters. Console.WriteLine ("Area of a rectangle: {0}",x); } public void Area(float a, float b, float c) { float s = (float)(a*b*c)/2; // here we have used function overload with 3 parameters. Console.WriteLine ("Area of a circle: {0}", s); } } Static void Main (string[] args) { Shape ob = new Shape (); ob.Area(2.0f); ob.Area(20.0f,30.0f); ob.Area(2.0f,3.0f,4.0f); Console.ReadLine (); } }} Things to keep in mind while method overloading If you use overload for method, there are couple of restrictions that the compiler imposes. The rule is that overloads must be different in their signature, which means the name and the number andtype of parameters. There is no limit to how many overload of a method you can have. You simply declare them in a class, justas if they were different methods that happened to have the same name.

Method Overriding:

Whereas Overriding means changing the functionality of a method without changing the signature. Wecan override a function in base class by creating a similar function in derived class. This is done by usingvirtual/override keywords.

Base class method has to be marked with virtual keyword and we can override it in derived class usingoverride keyword.

Derived class method will completely overrides base class method i.e. when we refer base class objectcreated by casting derived class object a method in derived class will be called.Example:

// Base class

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 7 / 26

Page 8: Introduction to Object Oriented Programming Concepts (OOPS)

public class BaseClass{public virtual void Method1(){Console.Write("Base Class Method");}}// Derived classpublic class DerivedClass : BaseClass{public override void Method1(){Console.Write("Derived Class Method");}}// Using base and derived classpublic class Sample{public void TestMethod(){// calling the overriden methodDerivedClass objDC = new DerivedClass(); objDC.Method1(); // calling the baesd class methodBaseClass objBC = (BaseClass)objDC; objDC.Method1();}}

Output---------------------

Derived Class Method

Derived Class Method

Constructors and Destructors:

Classes have complicated internal structures, including data and functions, object initialization andcleanup for classes is much more complicated than it is for simple data structures. Constructors anddestructors are special member functions of classes that are used to construct and destroy class objects.Construction may involve memory allocation and initialization for objects. Destruction may involve cleanupand deallocation of memory for objects.

Constructors and destructors do not have return types nor can they return values.References and pointers cannot be used on constructors and destructors because their addressescannot be taken.Constructors cannot be declared with the keyword virtual.Constructors and destructors cannot be declared const, or volatile.Unions cannot contain class objects that have constructors or destructors.

Constructors and destructors obey the same access rules as member functions. For example, ifyou declare a constructor with protected access, only derived classes and friends can use it tocreate class objects.The compiler automatically calls constructors when defining class objects and calls destructorswhen class objects go out of scope. A constructor does not allocate memory for the class objectit’s this pointer refers to, but may allocate storage for more objects than its class object refers to.If memory allocation is required for objects, constructors can explicitly call the new operator.During cleanup, a destructor may release objects allocated by the corresponding constructor. Torelease objects, use the delete operator.

Example of Constructor

class C{ private int x; private int y; public C (int i, int j) { x = i; y = j; } public void display () { Console.WriteLine(x + "i+" + y);

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 8 / 26

Page 9: Introduction to Object Oriented Programming Concepts (OOPS)

1 – 200 of 287 Newer› Newest»

}}

Example of Destructor

class D{ public D () { // constructor } ~D () { // Destructor }

}

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our

Facebook, Tw itter, RSS feed, or by email.

Enter your comment... Subscribe by RSS Subscribe by Email

287 comments :

46

1

2

3

4

5

Anonymous said...

nice art icle

April 28, 2010 at 9:21 PM

Anonymous said...

Nice Art icle good work

June 18, 2010 at 2:27 AM

siva said...

its very nice plz every one go throw it

siva

September 3, 2010 at 2:00 AM

just said...

its very useful

October 28, 2010 at 4:20 AM

Anonymous said...

very thank you.Now I come to know for what they are really meant for.I'm having a doubt on stat ic keyword.what is the use of stat ic and where it is really used.

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 9 / 26

Page 10: Introduction to Object Oriented Programming Concepts (OOPS)

6

7

8

9

10

11

12

13

14

15

16

17

18

December 19, 2010 at 10:47 PM

Anonymous said...

Thanku

January 25, 2011 at 5:03 AM

Anonymous said...

Thank you very much....It 's a very nice art icle and useful..

January 27, 2011 at 12:37 AM

kancheti venkat said...

I have Clarified my doubts in oops .ThanQ . Keep Rocking.

May 16, 2011 at 11:39 PM

Anonymous said...

nice n valuable info...

June 26, 2011 at 10:35 PM

sql said...

its very useful for all beginners ...really nice but i want some change ur website i.e i want to click sql tab then itw ill open another extra tab so dat much of burden to server..

July 19, 2011 at 11:34 PM

Prasanthi said...

Nice art icle on OOPS Concept.Good work

August 6, 2011 at 5:41 AM

Anonymous said...

its very useful for all beginners ...really nice

October 13, 2011 at 9:43 PM

Anonymous said...

Nice Art icle Good job Thanks

October 14, 2011 at 2:50 PM

Gopi said...

Hi Suresh

Good Job

October 17, 2011 at 12:04 AM

Tamil said...

Very nice.....

October 21, 2011 at 2:25 AM

Anonymous said...

Great work. Keep it up!

October 24, 2011 at 1:27 PM

Anonymous said...

hi suresh good job.

October 31, 2011 at 12:16 AM

komal said...

Very Very usefull suresh keep it up..and i daily read your blog and learn new thing every day..

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 10 / 26

Page 11: Introduction to Object Oriented Programming Concepts (OOPS)

19

20

21

22

23

24

25

26

27

28

29

30

31

November 6, 2011 at 7:50 PM

harani said...

art icle chala bagundi

November 15, 2011 at 2:03 AM

Anonymous said...

good

November 21, 2011 at 8:55 PM

Anonymous said...

not clear w ith constructor can u give more details

November 21, 2011 at 8:56 PM

Anonymous said...

good

December 7, 2011 at 11:00 PM

AMI said...

Very nice...and so simple

December 13, 2011 at 2:13 AM

Anonymous said...

Simple & Best

December 13, 2011 at 9:07 AM

Anonymous said...

thank u

December 14, 2011 at 3:57 AM

Anonymous said...

Good one...saved this link to share w ith my friends...Excellent work..:)

December 16, 2011 at 10:37 AM

Anonymous said...

Superb...........

December 22, 2011 at 5:01 AM

kotte said...

great boss good art icle

December 24, 2011 at 2:01 AM

Manoj said...

Very good art icle

December 28, 2011 at 12:41 PM

Anonymous said...

This is very useful to w ill grow ing software in engineers in all program languages

by-indian

January 2, 2012 at 10:16 AM

Basu said...

awesome art icle .....its very valuable thing for freshers.....

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 11 / 26

Page 12: Introduction to Object Oriented Programming Concepts (OOPS)

32

33

34

35

36

37

38

39

40

41

42

43

January 6, 2012 at 2:20 AM

Anonymous said...

Bahut badhiya cheeze hai.........!Mast banaya!

January 6, 2012 at 2:47 AM

Vinay Kumar said...

Great JOB Mr. Suresh....

January 9, 2012 at 10:22 PM

vijeesh said...

very nice.....

January 11, 2012 at 9:44 PM

vijeesh said...

very nice.....

January 11, 2012 at 9:45 PM

Anonymous said...

Very Nice! so Simple and easily Understand,Thank You!

January 11, 2012 at 10:03 PM

SHAN said...

Good Work,What are the Default Access Modifiers in C#?

if it is Internal please explain

January 12, 2012 at 8:33 PM

Anonymous said...

Nice Work Keep it up

January 19, 2012 at 11:19 PM

sangmeshwar Mandade said...

Thank You Sir

January 22, 2012 at 11:06 PM

Anonymous said...

In the inheritance example base class constuctor execured first ,then derived class constructor and then writemethod but i this art icle at one point it was determined that derived class inherits all base class members exceptconstructors....i am confused w ith it pls explain.......

January 27, 2012 at 7:40 AM

Rajesh said...

nice job suresh

January 30, 2012 at 10:27 PM

Naveen said...

its really good website for learners...

February 2, 2012 at 11:37 AM

Naveen said...

Best website to improve our skills...

February 2, 2012 at 11:38 AM

Vinod said...

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 12 / 26

Page 13: Introduction to Object Oriented Programming Concepts (OOPS)

44

45

46

47

48

49

50

51

52

53

54

Vinod said...

Nice to see these type of website...Really wonderful

February 2, 2012 at 11:40 AM

suresh mallina said...

its really good website for learners...

February 15, 2012 at 4:03 AM

Basavaraja K said...

Good Explanat ion w ith good Examples.

Please explain about Threading

Regards,Basavaraja K

February 16, 2012 at 8:24 PM

Anonymous said...

so nice very very very well

February 22, 2012 at 2:53 AM

Hari said...

CLEARED EACH CONCEPT IN A VERY SIMPLE MANNER... VERY FEW HAS SUCH SKILLS...IT 'S GOOD TO FIND SOME ONE WITH SUCH SKILLS...THANK YOU...GOOD LUCK AND HAVE GOOD DAY...

February 28, 2012 at 4:57 PM

Anonymous said...

Good Information ... awesome!!!!

It w ill be very great if provide the same w ith vb.net code aswell....

REGARDS,VAMSHIKRISHNA

March 8, 2012 at 7:17 PM

Anonymous said...

Hi.My name is sai krishna.

You are really great. Your explanat ion is simply super. Its very much useful for the interview point of view. Thankyou so much. I have learnt so much from this post.

God bless you.

March 19, 2012 at 2:55 AM

sankar said...

This is very good Art icles for beginers,and required more example to just ify your view.

March 24, 2012 at 1:31 AM

Anonymous said...

It 's really a good art icle.......!!!!!

April 2, 2012 at 4:34 AM

Anonymous said...

Really easy to understand. Thanks suresh

April 5, 2012 at 2:28 AM

Anonymous said...

Nice Easy To Understand. Thanks

April 9, 2012 at 2:20 AM

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 13 / 26

Page 14: Introduction to Object Oriented Programming Concepts (OOPS)

55

56

57

58

59

60

61

62

63

64

65

66

Sanjay said...

Very Nice .......Good job

April 12, 2012 at 11:45 PM

Anonymous said...

great man...it 's really very good...

April 17, 2012 at 12:15 AM

Deewar said...

Simple but clear thinking..nice

April 19, 2012 at 12:16 AM

Anonymous said...

thank you for your effort

April 20, 2012 at 9:39 AM

Munna said...

Please Post A program for Captcha..

April 21, 2012 at 11:11 AM

Anonymous said...

Very nice Art icle. It clear all points. very nice

April 24, 2012 at 3:09 AM

Anonymous said...

Nice Art icle but Method Overriding which is the most important concept is missing.

April 25, 2012 at 9:54 PM

Anonymous said...

It 's a very nice art icle and useful.

April 26, 2012 at 4:20 AM

rohansp said...

I think the concept of Abstract ion is slight ly different.The definit ion that you have given is for Encapsulat ion andnot Abstract ion.

Abstract ion is a mechanism that denotes the essent ial characterist ics of an object which dist inguish it from allother kinds of objects.

The process of hiding the details and present ing the interface to the user is called as Encapsulat ion.

Please clarify.

May 2, 2012 at 11:28 PM

v.manikandaboopathi said...

very nice to ease of understanding information

May 4, 2012 at 12:32 AM

Anonymous said...

this website is very helpful for improve ur skills

May 4, 2012 at 4:58 AM

justin said...

very nice your art icle suresh

ThanksJust in

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 14 / 26

Page 15: Introduction to Object Oriented Programming Concepts (OOPS)

67

68

69

70

71

72

73

74

75

76

77

78

79

May 8, 2012 at 6:27 AM

Murugavel Sadagopan said...

excellent art icle suresh

May 8, 2012 at 6:48 PM

youtube html5 player said...

Thanks for sharing your info. I really appreciate your efforts and I w ill be wait ing for your further write ups thanksonce again.

May 11, 2012 at 5:05 AM

Anonymous said...

good work sir..

real B O W for u...

May 14, 2012 at 12:48 AM

Anonymous said...

nice dear suresh..

May 16, 2012 at 9:08 PM

sandy said...

very nice art icle

May 20, 2012 at 11:45 PM

Ambily Ravi said...

very nice and easy to understanding thankz

May 29, 2012 at 4:54 AM

Anonymous said...

best art icle

May 29, 2012 at 10:17 PM

Anonymous said...

very useful and helps to understand the concepts easily....thanks suresh

May 30, 2012 at 12:24 AM

sanjeev kumar said...

Very Nice

June 1, 2012 at 10:18 PM

Anonymous said...

VERY NICE ARTICLE.....

June 5, 2012 at 4:38 PM

Anonymous said...

very useful link

June 12, 2012 at 12:42 AM

LP said...

Excellent!

June 12, 2012 at 3:52 AM

Anonymous said...

Excellent work. Keep it up.

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 15 / 26

Page 16: Introduction to Object Oriented Programming Concepts (OOPS)

80

81

82

83

84

85

86

87

88

89

90

91

shankar

June 13, 2012 at 3:25 AM

Anonymous said...

Excellent post !!!

June 13, 2012 at 2:48 PM

ammar said...

Its Awesome...

Good Work.

June 14, 2012 at 2:17 AM

Anonymous said...

It is very useful.......!!

Thank you,

June 16, 2012 at 4:06 AM

Anonymous said...

u done a great job sir i dont know anything about oops concept now i am very clear about oopsconcept.......thanqqq very much...sir!!

June 20, 2012 at 9:01 AM

ashref said...

very very very good art icle

June 21, 2012 at 7:47 PM

ankur said...

Best..........

June 25, 2012 at 1:25 AM

shruti said...

really nice.. looking forward to more such art icles from you

June 25, 2012 at 1:48 AM

Anonymous said...

good and easy art icle...

June 25, 2012 at 5:31 AM

Anonymous said...

wow..great job..

June 25, 2012 at 9:38 PM

all india radio said...

wonderful ..tnks ...

June 26, 2012 at 4:51 AM

Subha said...

Really nice post and a great blog to follow.... keep it up man...

June 26, 2012 at 6:57 AM

Murali said...

Good Work boss...

June 26, 2012 at 10:23 PM

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 16 / 26

Page 17: Introduction to Object Oriented Programming Concepts (OOPS)

92

93

94

95

96

97

98

99

100

101

102

103

104

Nilam Tetgure said...

Nilam Tetgure

great work keep it up.............

June 28, 2012 at 2:55 AM

Anonymous said...

very niceeeeeeee

June 28, 2012 at 7:00 AM

Anonymous said...

Very nice

June 28, 2012 at 11:37 PM

Ankit Patel said...

Nice art icle really helpful for me ...

June 29, 2012 at 9:04 PM

Anonymous said...

great, thnxs you

July 1, 2012 at 4:57 AM

Anonymous said...

I wonder u........

July 3, 2012 at 1:11 AM

Anonymous said...

very good suresh good art icle

July 9, 2012 at 5:15 AM

Anonymous said...

please provide some art icles in oops.

July 9, 2012 at 5:21 AM

Anonymous said...

thanks friend..........for this information

July 9, 2012 at 11:30 AM

Anonymous said...

Thanks sir,I am sourav really this docu is very helpful for every student or me.Because various topic are collect in a single place.I things this document is sufficient to pass any 2 yrs expe indotnet tech. thanks

July 11, 2012 at 1:43 AM

Anonymous said...

Thanks for refresh me.

July 11, 2012 at 11:42 AM

Anonymous said...

This is speechless for me

July 12, 2012 at 4:00 AM

Anonymous said...

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 17 / 26

Page 18: Introduction to Object Oriented Programming Concepts (OOPS)

105

106

107

108

109

110

111

112

113

114

115

116

117

good suresh keep it up.............

July 13, 2012 at 12:21 AM

Anonymous said...

This is very useful for me and easily understandable for us.so read every one.Thanks suresh sir,

July 13, 2012 at 4:50 AM

Prasad Mari said...

Excellent Art icle

July 14, 2012 at 2:04 AM

Anonymous said...

Good Art icle!!!! :)

July 16, 2012 at 5:30 AM

Praveen Kumar Srivastava said...

I am so happy and i gain good knowledge by your example.thank you so much friend

July 16, 2012 at 10:27 PM

Anoop said...

Excellent work.

July 17, 2012 at 6:42 PM

Salik Ram Maurya said...

Very helpful art icle

July 18, 2012 at 10:38 PM

Anonymous said...

Thank You Suresh... Its Very helpfull..

July 19, 2012 at 9:59 AM

Anonymous said...

nice

July 23, 2012 at 2:52 AM

Narendran said...

great work

July 26, 2012 at 12:05 AM

v.manikandaboopathi said...

realy very nice art ical

July 27, 2012 at 1:31 AM

v.manikandaboopathi said...

sent me asp.net Quest ion

July 27, 2012 at 1:33 AM

Vikas Sharma said...

Thanks a lot for providing this type of notes Through which my all the queries are sought out . thanks again

July 28, 2012 at 9:52 AM

Asif said...

Thanks for such a simple art icle on OOPS. Great work keep it up.

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 18 / 26

Page 19: Introduction to Object Oriented Programming Concepts (OOPS)

118

119

120

121

122

123

124

125

126

127

128

129

July 29, 2012 at 12:44 AM

linoy said...

Linoy said,

Good art icle ,,,,

July 31, 2012 at 11:23 PM

Revathy said...

Thank U so much suresh....i felt u explained clearly but i want to know how to create dll and how can use tat incoding.so could u plz give some examples???

August 6, 2012 at 11:55 PM

Gobi Selvaraj said...

nice to read...keep it up. Gud work. God bless you

August 16, 2012 at 8:29 AM

Anonymous said...

nice art icle

August 23, 2012 at 4:45 AM

viresh rajput said...

Very nice post Suresh

August 23, 2012 at 10:45 PM

Arun Kumar Yadav said...

it 's awesome sir..............keep update.......

August 24, 2012 at 3:29 AM

Anonymous said...

encapsulat ion definat ions is given for abstract ion.

August 26, 2012 at 11:25 PM

Vishal Srivastava said...

Thanks Suresh..its Help me a lot..

August 28, 2012 at 9:13 PM

Anil said...

good coverage of basic concepts..

August 29, 2012 at 5:01 AM

Anonymous said...

nice by R.Mugundhan

September 3, 2012 at 6:14 AM

Anonymous said...

Nice topic

September 3, 2012 at 10:09 PM

kalai arasan said...

i need your suggest ion for me regarding sharing my web applicat ion to print in ubuntu platform w ithout deployany program in ubuntu. did you have any idea inform me on [email protected],i am wait ing foryour valuable reply sir...

September 5, 2012 at 4:50 AM

Balaji Thirunavukarasu said...

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 19 / 26

Page 20: Introduction to Object Oriented Programming Concepts (OOPS)

130

131

132

133

134

135

136

137

138

139

140

141

142

Balaji Thirunavukarasu said...

i want mysql stored procedure using login page and register page . i have created login page and register pageusing mysql stored procedure in asp.net.in this @ parameter is used to insert in the text value stored null value inmysql database .i dont know how to @parameter using in asp.net at mysql . i want mysql support Query storedprocedured query. Please help me

September 7, 2012 at 5:39 AM

Anonymous said...

Nice art icle w ith easily understandable examples

September 15, 2012 at 4:16 AM

Anonymous said...

Very nice post

September 15, 2012 at 4:56 AM

Anonymous said...

great post

September 16, 2012 at 10:30 PM

Arun said...

Great Post

September 16, 2012 at 11:46 PM

suman said...

very help full post ..Nice gr8 work

September 20, 2012 at 4:03 AM

sonalis shinde said...

This comment has been removed by the author.

September 20, 2012 at 6:09 AM

Anonymous said...

very nice but concept of constructor lit t le bit confusing because as you write that constructor cannot define asstat ic but constructor can define as stat ic.

September 23, 2012 at 11:41 AM

Anonymous said...

thank you.. To give clear information about oops..

September 24, 2012 at 1:41 AM

Anonymous said...

ThankYou great post this art icle helped me lot

September 24, 2012 at 7:16 AM

somesh said...

Hi dudeNice blog.

September 27, 2012 at 9:25 PM

Abhimanyu said...

THANKS A LOT FOR HELP ME...!

To give clear information about oops.

September 29, 2012 at 10:08 AM

saurabh khare said...

oops concept its very nice

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 20 / 26

Page 21: Introduction to Object Oriented Programming Concepts (OOPS)

143

144

145

146

147

148

149

150

151

152

153

154

September 30, 2012 at 1:13 PM

Anonymous said...

Thanks a lot man..One word for u..U ROCK..

October 1, 2012 at 4:27 AM

Anonymous said...

good n meaningful

October 2, 2012 at 9:27 AM

habeeb said...

good nice......byhabeeb

October 2, 2012 at 3:08 PM

Anonymous said...

FYI:"Constructors and destructors cannot be declared stat ic, const, or volat ile"U are wrong suresh,constructors can be stat ic :)

October 4, 2012 at 6:26 AM

Dinesh said...

Just want to share my answer for comment 5: Stat ic, Stat ic refers to the nature of the member as independent of object. ex: Stat ic members can be called w ithoutcreat ing object.

October 4, 2012 at 12:06 PM

sivarajan said...

nice good art icle

October 7, 2012 at 6:30 AM

mayank said...

nice art icle.....

October 9, 2012 at 4:15 AM

Anonymous said...

very gud :) keep it

October 12, 2012 at 11:12 AM

nitesh sharma said...

Than sir it is very gud.....

October 13, 2012 at 4:17 AM

jayakumar chinta said...

very nice....................

October 14, 2012 at 9:00 PM

Anonymous said...

Hey... It 's really help me to understand the concepts... Thanks...

October 16, 2012 at 7:04 AM

Anonymous said...

very informative.

October 18, 2012 at 4:07 AM

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 21 / 26

Page 22: Introduction to Object Oriented Programming Concepts (OOPS)

155

156

157

158

159

160

161

162

163

164

165

166

167

168

Anonymous said...

Senthil:Nice art icle

October 18, 2012 at 4:18 AM

h said...

js superb..........

October 18, 2012 at 4:41 AM

Anonymous said...

Good explanat ion for interviews..

October 18, 2012 at 6:53 AM

Anonymous said...

Really Nice...

October 24, 2012 at 3:44 PM

Harsha said...

thank you...

October 27, 2012 at 8:06 AM

santosh kushwaha said...

good for beginner and also exp guys.

October 27, 2012 at 12:42 PM

Unknown said...

Thanks so much... great help...

October 28, 2012 at 6:24 AM

Anonymous said...

very useful oops concepts..thank u...

October 28, 2012 at 6:28 AM

sanjay bathre said...

thank you ..... great art icle

October 30, 2012 at 12:37 AM

Anonymous said...

Gud Job..H

October 31, 2012 at 4:38 AM

NANDISH said...

VERY GUD..

October 31, 2012 at 6:17 AM

Pradeep said...

It is very gud art icle..it cleared most of doubts thet were in my mind...thanku

October 31, 2012 at 6:19 AM

Anonymous said...

nice

November 1, 2012 at 5:27 AM

Anonymous said...

Nice one...very helpful

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 22 / 26

Page 23: Introduction to Object Oriented Programming Concepts (OOPS)

169

170

171

172

173

174

175

176

177

178

179

180

181

November 1, 2012 at 5:44 AM

Dhananjay Gupta said...

very good example of oops

November 2, 2012 at 10:51 AM

Anonymous said...

Good commant

November 4, 2012 at 2:04 AM

Anonymous said...

its very useful notes for begginer thanks for that notes i understand all the conceot

November 5, 2012 at 7:38 AM

Anonymous said...

Nice and anyone can understand easily....

November 5, 2012 at 9:18 AM

Anonymous said...

Thank u suresh

November 5, 2012 at 9:20 PM

Virendra Puskar said...

gud

November 5, 2012 at 9:21 PM

Anonymous said...

great post!

November 6, 2012 at 11:21 PM

Nitish Kumar said...

Sir, Thank you very much. I had very confusion about opp concept you made it clear to me. Thanks...

November 7, 2012 at 11:00 PM

Anonymous said...

Nice Work

November 9, 2012 at 2:03 AM

mohanbabu mohan said...

blogs are very nice.........thank u suresh

November 9, 2012 at 5:56 PM

Anonymous said...

Nice Art ical for beginners... Thank u Suresh :)

November 15, 2012 at 11:33 PM

Anonymous said...

Nice Art ical for beginners

November 16, 2012 at 4:40 AM

Anonymous said...

I am sourav really this docu is very helpful for every student or me.Because various topic are collect in a single place.I things this document is sufficient to pass any 2 yrs expe indotnet tech.

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 23 / 26

Page 24: Introduction to Object Oriented Programming Concepts (OOPS)

182

183

184

185

186

187

188

189

190

191

192

193

194

November 16, 2012 at 4:41 AM

Anonymous said...

Nice Art ical for beginners

November 16, 2012 at 4:49 AM

MallaReddy said...

Really very nice for beginners.

November 16, 2012 at 10:29 PM

Anonymous said...

Very Nice...! Any beginner can understand easly.Thanks....!

November 20, 2012 at 11:34 PM

Anonymous said...

very good art icle for learners....

November 27, 2012 at 3:03 AM

Anonymous said...

Very nice. Thank you.

November 28, 2012 at 11:49 PM

Anonymous said...

why we can't use mult iple inheritence in C#

November 29, 2012 at 6:32 AM

Anonymous said...

excellent...thanks!

November 30, 2012 at 2:39 AM

Anonymous said...

------

November 30, 2012 at 2:44 AM

Anonymous said...

Excellent work yaar!!!

November 30, 2012 at 9:07 AM

Nageswar said...

nice

December 4, 2012 at 12:14 AM

Anonymous said...

nice conpects...

December 4, 2012 at 2:14 AM

Anonymous said...

no word to describe.....

December 4, 2012 at 8:22 AM

Anonymous said...

very good art icle

December 6, 2012 at 8:21 AM

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 24 / 26

Page 25: Introduction to Object Oriented Programming Concepts (OOPS)

1 – 200 of 287 Newer› Newest»

Newer Post Older Post

Give your Valuable Comments

Aspdotnetsuresh

Like

5,379 people like Aspdotnetsuresh.

Facebook social plugin

Home

Subscribe to: Post Comments ( Atom )

Other Related Posts

ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL ServerC# - Difference between Abstract class and Interface in Asp.Net ...Joins in sql server, Inner Join,Cross Join,Left Outer Join,Equi join ...AS3 KeyBoard Event Key Codes | Alphabet, Numbers, Special ...jQuery Allow Only Alphabets in Textbox using JavaScript - ASP.NET ...

Asp.net insert, Edit, update, delete data in gridview

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net

Introduction to WCF - WCF tutorial | WCF Tutorial - Windows Communication Foundation | WCF Example |WCF Sample code in asp.net 3.5 | Basic WCF Tutorial for Beginners

how to insert images into database and how to retrieve and bind images to gridview using asp.net (or)save and retrieve images from database using asp.net

Simple login form example in asp.net Check Username and Password availability in database

3 tier architecture example in asp.net with C#

Interview Questions in ASP.NET,C#.NET,SQL Server,.NET Framework

195

196

197

198

199

200

Anonymous said...

woww very good art icle...

December 7, 2012 at 10:27 AM

Anonymous said...

You are the Man !!!!

December 13, 2012 at 1:40 AM

Karthikeyan S said...

It s very useful and easy to understand..Thank you Suresh..:)

December 14, 2012 at 9:36 PM

Anonymous said...

nice dude

December 15, 2012 at 2:42 AM

Anonymous said...

thanx for art icle it useful to understand the concept easily

December 15, 2012 at 10:19 PM

NITIN DONGRE said...

Good Work.Keep it on..............

December 18, 2012 at 10:31 PM

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 25 / 26

Page 26: Introduction to Object Oriented Programming Concepts (OOPS)

Ajax ModalPopUpExtender Example to edit the gridview row values in asp.net

Ajax Cascading Dropdownlist Sample with database using asp.net

how to save images into folder and images path in database and display images from folder in gridviewbased on images path in database using asp.net

© 2010-2012 Aspdotnet-Suresh.com. All Rights Reserved.The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission fromthe owner.

Introduction to Object Oriented Programming Concepts (OOPS) in C#.net - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview,SQL Server,Ajax,SSRS, XML examples 4/26/2013

http://www.aspdotnet-suresh.com/2010/04/introduction-to-object-oriented.html 26 / 26