Check out example codes for "parameterized constructor in c#". It will help you in understanding the concepts better.

Code Example 1

/*
Parameterized Constructor

A constructor having at least one parameter is called as 
parameterized constructor. It can initialize each instance of the class 
to different values.
*/
// C# Program to illustrate calling of 
// parameterized constructor. 
using System; 
namespace ParameterizedConstructorExample { 

class Geek { 

	// data members of the class. 
	String name; 
	int id; 

	// parameterized constructor would 
	// initialized data members with 
	// the values of passed arguments 
	// while object of that class created. 
	Geek(String name, int id) 
	{ 
		this.name = name; 
		this.id = id; 
	} 

	// Main Method 
	public static void Main() 
	{ 

		// This will invoke parameterized 
		// constructor. 
		Geek geek1 = new Geek("GFG", 1); 
		Console.WriteLine("GeekName = " + geek1.name + 
						" and GeekId = " + geek1.id); 
	} 
} 
} 

//Output:
GeekName = GFG and GeekId = 1

Code Example 2

//Types of Constructors in C#

1. Default Constructor
2. Parametrized Constructor
3. Copy Constructor
4. Private Constructor
6. Static Constructor

Learn ReactJs, React Native from akashmittal.com