0% found this document useful (0 votes)
56 views1 page

G Testout Resources MSDevNet CSharp Oop

The document defines key object-oriented programming concepts including classes, objects, methods, fields, properties, events, and namespaces. Classes are templates used to create objects and contain member variables and methods. Objects are instances of classes. Methods define a program's behavior. Fields track an object's state. Properties provide indirect access to fields. Events allow objects to notify event handlers of occurrences. Namespaces organize programs and prevent naming collisions.

Uploaded by

samprasad
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views1 page

G Testout Resources MSDevNet CSharp Oop

The document defines key object-oriented programming concepts including classes, objects, methods, fields, properties, events, and namespaces. Classes are templates used to create objects and contain member variables and methods. Objects are instances of classes. Methods define a program's behavior. Fields track an object's state. Properties provide indirect access to fields. Events allow objects to notify event handlers of occurrences. Namespaces organize programs and prevent naming collisions.

Uploaded by

samprasad
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Object Oriented Programming Concepts Page 1 of 1

Object-oriented Programming Concepts

An object-oriented program is a collection of objects sending messages to one another. The following table lists
several terms with which you should be familiar.

Term Description
Classes are the basic unit of any object-oriented language.

Classes  Classes are the templates used to create objects.


 Classes can be used to define new data types.
 All programming must be done inside of a class.
 Classes contain member variables and member methods.
An object is an instance of a class.

Object  Instances are created by declaring a variable of the class type to hold a reference to an
instance (or object) of that class.
 Instantiate or create a new instance of a class using the new keyword.
The behavior of the program is defined inside the body of methods.
Method
 All methods must be in a class.
 Methods consist of a header and zero or more statements
The fields of a class are the data members (variables) that are used to track the state of the class.

Fields  Data members are variables declared inside of the class.


 Data members can be variables of any type.
 Data members usually cannot be directly accessed outside of the class.
 Properties provide a nice way of indirectly accessing data members outside of a class.
In a generic sense, a property is any data member or field associated with an object. Properties are
unique to a class instance. In a way, it is the object's properties that differentiate one object from
another. In a strict sense, object properties are better referred to as fields or data members.
Properties
In a formal sense, a property is a programming construct that lets you access (get) or modify (set)
the fields of an object.
An event is a class member that enables an object or class to provide notifications. You can write
Event event handlers that link code to events. When the event occurs, the code in the linked handlers is
executed.
Namespaces are used to organize the program and prevent name collisions.

Namespace  Namespaces contain classes, a variety of other programming constructs, or other


namespaces.
 The System namespace ultimately contains all of the namespaces and classes in the .NET
libraries.

file://G:\Testout\resources\MSDevNet\CSharp\oop.htm 10/17/2010

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy