300x250 AD TOP

helooo
Tagged under:

Class & Object


Class:

A class is a construct that enables you to create your own custom types by grouping together variables of other types, methods and events. A class is like a blueprint. It defines the data and behavior of a type. 

                                                                        (OR)

The class is the fundamental building block of code when creating object-oriented software. A class describes in abstract all of the characteristics and behavior of a type of object. Once instantiated, an object is generated that has all of the methods, properties and other behavior defined within the class.


public class Customer
{
    //Fields, properties, methods and events go here...
}


Object:
 In C#, is an instance of a class that is created dynamically. Object is also a keyword that is an alias for the predefined type System.Object in the .NET framework.

public class Customer
{
    //Fields, properties, methods and events go here...
}
Public  class mainclass
{
     Public static void Main()
{
Customer cus=new Customer();//Object
}
}



Pictorial Representaion




Attribute are variables or properties 

Behavior means methods of a class to carry out a particular task