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 »
Tags:
Classes and Structs,
OOPS Concept
