Wednesday, 21 September 2016
Simple Definition of Constructor and Constructor Types in C#.NET
Here I explaining about Constructors in C#.net in simply manner.
Types of constructors:
Instance Constructors
1. Default Constructor
2. Parameterised Constructor
3. Copy Constructor
4. Private Constructor
Non-Instance Constructors
1. Static Constructor
- A Constructor is a member method of a class. Which is imported automatically when an object to the class is created.
- A Constructor name should be same name as class name.
- A constructor doesn't have any return type even void also.
- A Constructor is used to keep something ready for the object when it its created.
- A Constructor is used to initialize required values into the required fields into the data fields of the class.
Types of constructors:
Instance Constructors
1. Default Constructor
- User Define
- System Defined
2. Parameterised Constructor
3. Copy Constructor
4. Private Constructor
Non-Instance Constructors
1. Static Constructor
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment