C# reflection, interfaces, abstract class, generics, ref vs out, C# versions 4,5,6 and features.

C# using statement - Why and How?

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...

Continue Reading

C# Versions and Features

C# versions C# 1 comes in 2002 with .NET framework 1.0 and Visual Studio 2002 C# 2 comes in 2005 with .NET framework 2.0 and Visual Studio 2005 C# 3 comes in 2008 with .NET framework 2.0 and Visual Studio 2008 C# 4 comes in 2010 with .NET framework 4.0 and Visual Studio 2010 C# 5 comes in 2012 with .NET framework 4.5 and Visual Studio...

Continue Reading

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: Array is fixed in size. We specify the...

Continue Reading

C# params

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 ...

Continue Reading

ref vs out parameters

This post is about difference between ref and out parameters. C# provides three keywords when you defining a method signature. These keywords are: params ref out By default, method arguments are passed by value. That means calling method pass a duplicate copy of data to the called method. If called method modifies the data, it will not visible to calling met...

Continue Reading

Join our newsletter and get an occasional email with a technology and dotnetpattern.com news update.