C#

Linear Search and Binary Search in C#

Linear Search and Binary Search in C#

In this post, you will learn Linear Search and Binary Search in C#. Searching algorithms have applications in many computer science applications. Basically, searching algorithms allow the user to find a target element given the list of elements. In fact, we can use two common searching techniques – The Linear Search and Binary Search to …

Linear Search and Binary Search in C# Read More »

Understanding Method Parameter Modifiers in C#

Understanding Method Parameter Modifiers in C#

C# language allows the use of certain modifiers with parameters of a method. Basically, these Method Parameter Modifiers effects the manner in which the corresponding method makes use of that parameter. In this post on Understanding Method Parameter Modifiers in C#, you will learn four of the parameter modifiers – ref, out, params, and in. …

Understanding Method Parameter Modifiers in C# Read More »

Examples of Static Constructors in C#

Examples of Static Constructors in C#

In this post, I will explain a few Examples of Static Constructors in C#. The static constructors in a class serve the purpose of initializing the static fields in that class. Therefore, if you have the static fields defined in a class, then use the static constructor to initialize them. Since static fields are applicable …

Examples of Static Constructors in C# Read More »

Private and Static Constructors in C#

Private and Static Constructors in C#

In this post, I will cover Private and Static Constructors in C#. Private constructors restrict the creation of objects. In fact, if the private constructor is there, you cannot create objects in a similar fashion. You can only use private constructors inside some method of that class only. In contrast, if you define a constructor …

Private and Static Constructors in C# Read More »