A class is like a blueprint of specific object. In the real world, every object has some kinds of data and functionalities. For example, the iPhone . iPhone is an object of the Smartphone type. The Smartphone is a class that specify certain characteristic like Display size,Color ,Weight, Thickness etc. So any company that makes a Smartphone that meet those requirements is an object of the Smartphone type. For example, every single Smartphone of Apple, Samsung, BlackBerry are an object of the class called 'Smartphone'. Here, 'Smartphone' is a class and every single physical Smartphone is an object of the Smartphone class.
Likewise, in object oriented programming, a class defines certain properties, fields, events, method etc. A class defines the kinds of data and the functionality their objects will have.
A class enables you to create your own custom types by grouping together variables of other types, methods and events.
In C#, a class can be defined by using the class keyword.
public class Smartphone
{
public double length;
public double breadth;
public double height;
public Smartphone()
{
}
}
Likewise, in object oriented programming, a class defines certain properties, fields, events, method etc. A class defines the kinds of data and the functionality their objects will have.
A class enables you to create your own custom types by grouping together variables of other types, methods and events.
In C#, a class can be defined by using the class keyword.
public class Smartphone
{
public double length;
public double breadth;
public double height;
public Smartphone()
{
}
}
Comments
Post a Comment