INTRODUCTION
In this Article We will Explain about Following types of Concept
- What is Classes
- Purpose of Class Constructor
- OverLoading Class Constructor
- Destructors
Class Consists of Data and behavior.Class Data Reperseneted Its by fields and Behavior is Represented by Methods .if you want Create complex Custom types then we can use make Use Classes.What is Mean Complex custom type lets say for Example if i want store number if can do that with integer.if i want store Customer personal information i can use classes. how to do we create class we use Class KeyWord followed by the Name.
- public class Student /*Create Class we use class keyword Followd By the name . i am using Student My class Name*/
Purpose Of Class Constructor
The Purpose Of class Constructor is to initialize class Fields. A class Constructor is Automatically Called when an instance of class is created.
Constructor Do not have return values and always have same of the class .constructors are not mandatory.if we do not provide constructor default parameter less constructor is automatically Provided .Constructors can be overloaded by the number and type of parameters.
Constructor is not mandatory.if we not provide Constructor Class automatically Called Default Constructor.
Constructor Basicllay used Instalize class Fields.Let Say Example of the Code For Your clear Explain,
Constructor Do not have return values and always have same of the class .constructors are not mandatory.if we do not provide constructor default parameter less constructor is automatically Provided .Constructors can be overloaded by the number and type of parameters.
Constructor is not mandatory.if we not provide Constructor Class automatically Called Default Constructor.
Constructor Basicllay used Instalize class Fields.Let Say Example of the Code For Your clear Explain,
- // Default Constructor
- public Student(): this("No First name Provided", " No Lastname Provided") {}
- // Declaring Parameterized constructor with Parameters
- public Student(string Firstname, string Lastname) {
- this._firstname = Firstname;
- this._lastname = Lastname;
- }
Destructor

SubashPosted Mar 17, 2017, 9:30 PM
Very good work nice share
Anu VPosted Mar 16, 2017, 12:10 PM
Nice article thanks for sharing...