Gives solution for any Error occurs in any Programming Language, .Net Core 3.1, 3.0, C#,Asp.Net,Sqlserver,MVC,Java,Php,Html,Css,Jquery,errors and solutions,Latest News,Technology

Wednesday 21 September 2016

Simple Definition of Constructor and Constructor Types in C#.NET

No comments :
Here I explaining about Constructors in C#.net in simply manner.

  • 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

No comments :

Post a Comment