Interview Experience - New Members - IT Companies - Peer Appraisal - Members - Revenue Sharing - New Posts - Social

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

6/29/2014 .NET tutorials: Classes and Object model in .

NET
http://www.dotnetspider.com/tutorials/DotNet-Tutorial-272.aspx 1/2
Interview Experience | New Members | IT Companies | Peer Appraisal | Members | Revenue
Sharing | New Posts | Social |
+575 Recommend this on Google
Active Members
Today
narasiman (5)
Last 7 Days
Pawan Awasthi
(82)
Asheej T K (58)
naveensanagase...
(37)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
DotNetSpider
8,021 people like
DotNetSpider.
Like
Talk to
TutorialsDotNet tutorials
Classes and Object model in .NET
Classes and Object model in .NET
We will start with an introduction to what is object oriented programming, how to write simple classes,
creating objects etc.
What is a 'class' ?
In modern object oriented programming, large computer programs are divided into several 'classes'. Typically,
a large project will have several hundred classes. A class represents an entity in a program. For example, if
you are doing a small program called calculator, you will typically have a single (or more) class called
'Calculator' (you can give any name for your class). The class will have several 'methods', that will do the
functionality of the class.
So, your calculator may have methods like the following:
Add()
Subtract()
Multiply()
Divide()
Here is a sample calculator class, written in C# :
using System;
public class Calculator
{
public int Add(int value1, int value2)
{
return value1 + value2;
}
public int Subtract(int value1, int value2)
{
return value1 - value2;
}
Login Register
Search
Tutorials Forum Career Development Articles Reviews Jobs Practice Tests Projects Code Converter
6/29/2014 .NET tutorials: Classes and Object model in .NET
http://www.dotnetspider.com/tutorials/DotNet-Tutorial-272.aspx 2/2
Webmaster
Tony John
Online Members
sandip
More...
public int Multiply(int value1, int value2)
{
return value1 * value2;
}
public int Divide(int value1, int value2)
{
return value1 / value2;
}
}
Classes and objects
[To be added.]
Object model in .NET
[To be added.]
Next Chapter: Property in C# class
Previous Chapter: DataTypes in C#
More Chapters: .NET Tutorials
More Tutorials: Tutorial Index
About Us Contact Us Copyright Privacy Policy Terms Of Use Advertise
Copyright SpiderWorks Technologies Pvt Ltd., Kochi, India

You might also like