What is class with example
In this article I'm going to explain What is class with example.
What is Class?
Class is simply a representation of a type of object. It is the template / blue print that describe the detail of an object.
Class is a group of related methods and variables. The class can have any of the following members.
Class are reference type. Classes will support inheritance.Classes can have explicitly parameterless constructors.
Member variable initialization is possible in class.It is possible to declare destructor in class.
Methods are used to perform some task.
Same name as class name its called Constructors.
A field is the variable created within the class and its used to store data of the class.
Properties are used to provide access to ther private fields of the class.A property contains two accessors, get and set
// Assign this._name
this._name = "Kumar";
// Assign _name
_name = "Rengan";
// The two forms reference the same field.
static void Main()
PerlClassExample objectPerlClassExample = new PerlClassExample();