C#

C# Generic Methods

In my previous post, I explained about Generics. C# also provides generic methods. We can create a method that defers the parameter data type until the method is called. These parameters are called type parameters, which means we can pass the actual data type later. Below is an example of …

C# Generic Methods Read More
C#

C# Generics

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 …

C# Generics Read More
C#

C# ArrayList

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: …

C# ArrayList Read More
C#

C# Hashtable

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, …

C# Hashtable Read More
C#

C# Convert string to int

In C#, there are there ways for converting string to int. Each way has its own advantages and disadvantages. These ways are: int.Parse method int.Parse method converts string input into integer. It takes the string input and returns int as output. Before using the int.parse, we must sure the string has a valid …

C# Convert string to int Read More
C#

ConcurrentDictionary in C# – Introduction, Examples

ConcurrentDictionary is one of five collection classes introduced in.NET 4.0. It exists in System.Collections.Concurrent namespace. ConcurrentDictionary is a thread-safe collection class to store key-value pairs. ConcurrentDictionary can be used with multiple threads concurrently.  Without ConcurrentDictionary class, if we have to use Dictionary class with multiple threads, then we have to use locks to …

ConcurrentDictionary in C# – Introduction, Examples Read More