Dynamic Keyword in C#

    Dynamic Keyword        In C# 4.0 dynamic keyword was introduced, the advantage of dynamic keyword is that the actual type of variable of dynamic type is decided at run time. You can initialize the variable of dynamic type with any type of value or even if...

Sealed Class in C#

Sealed Class    Sealed classed can not be inherited, if you try to inherit from a sealed class then you will get a compile time error. Sealed classes are declared using a sealed keyword as shown below. public sealed class sealedClassDemo    {     ...

Class and Object in C#

 Class and Object    Class in C# contains different data members and functions/methods and it binds them together. We can access the data members and functions of a class using objects of a class. Class is nothing but a blueprint of a object. You will better understand class by looking at following example.    public class Test    {      ...

Async and Await in C# - Asynchronous Programming

Async and Await     Async and await are the two most important keywords in C# while doing asynchronous programming. Async keyword is used to in the signature of a method to denote that this method will be executed asynchronously, if you are making a method async then you need to...

Extension Methods in C#

Extension Methods    Extension method in C# enable us to extend the functionality of a type without deriving from it, in simple terms we can add a method to an existing type. Extension method is a static method in a static class. Extension method will be very clear when you will see below...

Constructors in C#

 Constructors    Constructors are used to initialize the data members of when an instance of a class is created. Name of the constructor is always same like class name. Find the example of an constructor below.        class Test     {        public Test()  -------> Constructor      ...

Interfaces in C#

 Interfaces    Interfaces in C# are like pure abstract class. Any method in an interface can not have implementation and we can only provide the declaration of those methods. All the methods in an interface are by default marked as abstract and public and we need not to mention that. Using interface we can also achieve multiple inheritance in C#. We also can not create an object...