Today I will explain a Static Class Example in C#. To begin with, let us first understand what is a static class. Static Class in C# Basically, a static class in C# is a class, which can’t be instantiated. Therefore, the purpose of creating a static class is to define methods that can’t be associated …
Rotating an Array in C#
The following code example demonstrates Rotating an Array in C#. In fact, array rotation is a programming exercise that helps you improve programming logic. Moreover, it also requires students to develop critical thinking and to find think about logic to solve a problem in an efficient manner. In other words, the application logic needs to …
Generic IList Interface and its Implementation in C#
In this article, I will explain Generic IList Interface and its Implementation in C#. In fact, the .NET Framework library provides a Collections framework that contains the implementation of commonly used data structures. Further, there are generic as well as non-generic collections that exist in the library. While non-generic collections can work on any type. …
Recursive Binary search in C#
The following code example demonstrates the Recursive Binary search in C#. Basically, searching is a very important algorithm in computer science. In fact, almost every application requires the use of searching. Hence, an efficient implementation of the searching algorithm can have substantial improvement in the overall performance of the applications. Searching Techniques In short, there …
C# Practice Questions
The following C# Practice Questions will help you learn the C# language. C# Practice Questions – Basic Programs Understanding the compilation and running of programs on VS.NET 2019. Write a program that displays following: “A simple C# Program.” Create a program that converts temperature specified in Celsius into Fahrenheit.Write a program to compute area of …
Creating Navigation Window Application Using WPF in C#
In this article, I will explain Creating Navigation Window Application Using WPF in C#. To begin with, let us first understand what a navigation window is. Navigation Window Basically, we create a navigation window using the Navigation class. Further, the Navigation class is a subclass of the Window class. Therefore, it inherits all the properties, …
Find Intersection Using Arrays
This article explains how to Find Intersection Using Arrays in C#. Basically, the intersection is a set operation. In general, we compute intersection by taking the common elements from two sets. For instance, consider the following example. The following code shows how to find intersection using arrays. As can be seen in the code, the …
An array of Objects and Object Initializer
In this article, I will explain how to use An array of Objects and Object Initializer in C#. To begin with, let us first understand what is an array. Basically, an array is a collection of elements, all of which have the same data type. Further, in a programming language such as C#, we can …
Performing Set Operations in LINQ
In this article, I will explain how to perform Set Operations in LINQ. Basically, Language Integrated Query (LINQ) has several query methods for performing set operations such as union, intersection, and set difference. Query Methods for Performing Set Operations in LINQ The following section provides a description of query methods available in LINQ. In fact, …
Using Quantifiers in LINQ
In this article, I will explain how to use Quantifiers in LINQ. Basically quantifiers are operators that return a boolean value. Further, these quantifier operators return a value that indicates whether all elements in a set satisfy a particular condition or only few. Also, whether a specific element is available in the set. Accordingly, the …