In my previous post, I explained about Generics. C# also provides Generic Methods. We can create a method which defer the parameter data type until the method is called. These parameters are called Type parameters that means we can pass the actual data type later.
Below is the example of Generic Method.
static void Swap<T>(ref T input1, ref T input2)
{
T temp =...

Generics are introduced in C# 2.0. It is the most powerful features of C#. In C# 1.0, when we design a class that use other types that is not known at defining the structure of the class, then type should be an object type. In the class, we have to typecast the type using boxing and unboxing and then we can use the type.
Generics introduced the concept of type parameters. Wi...

C# Hashtable class is a collection class where we can store data in the key/value pair. Hashtable is not type-safe. Hashtable is not generic and both key and value are based on object type.
Hashtable is used to store unique keys data. If we try to assign value to already used key, it just overrides the previous stored data.
It is based on the Hashing algorithm&n...

This article is an introduction to the C# using statement and explain why and how to use it. I'll also describe features of using statement and examples of nested using.
In C#, every object is using some resources managed or unmanaged internally. Client is responsible for life cycle of the object. Life cycle of the object means creation or destroying the object...

C# ArrayList is a non-generic dynamic size collection class. ArrayList class exists in System.Collections namespace. ArrayList are dynamic means we can add any number of items without specifying the size of it.
ArrayList vs Array
ArrayList and Array looks same. But there are some major differences between them. Differences are:
Array is fixed in size. We specify the...

C# params allows you to design a method which accepts variable number of parameters. These parameters are stored in an array and available to called method.
static void DoWork(params int[] arr)
{
if (arr != null)
{
foreach (var i in arr)
{
Console.WriteLine(i);
}
}
}
There are two ways to send parameters using params keyword:
You can fill ...