Showing posts with label Classes and Structs. Show all posts
Showing posts with label Classes and Structs. Show all posts

Friday, 16 November 2012

Classes and Structs

0 comments Posted by Unknown at 08:39

Classes and Structs

Classes and structs are essentially templates from which you can create objects. Each object contains data and has methods to manipulate and access that data. The class defines what data and functionality each particular object (called an instance) of that class can contain. For example, if you have a class that represents a customer, it might define fields such as CustomerID, FirstName, LastName, and Address, which you will use to hold information about a particular customer. It might also define functionality that acts upon the data stored in these fields. You can then instantiate an object of this class to represent one specific customer, set the field values for that instance, and use its functionality.

class PhoneCustomer
{
   public const string DayOfSendingBill = "Monday";
   public int CustomerID;
   public string FirstName;
   public string LastName;
}
Read More »
 

Popular Posts

Recent Comments

© 2011. All Rights Reserved | Object Orienred Programming | Template by Blogger Widgets

Home | About | Top ▲