Structure in C# with Example

In C#, structure is very useful if you want to store some custom data.  Like a Class in C#, a structure can also have fields, methods, properties, and constructors.  Structure is pretty much similar to a class, but there are some differences between a structure and a class.  Structure is of value type and class

Properties in C# with Example

Before we start digging into properties, you need to know why we need properties.  Properties and access modifiers help in encapsulation.  Encapsulation in simple terms inclusion of one thing into another, so that the included thing should not be directly accessible or visible.  Encapsulation is one of the primary pillars of object oriented programming.  We

Method Overloading in C# with Example

We know very well how to create methods in C#.  We basically create methods to increase the code reusability.  Suppose if you want to add 2 numbers, you can create a method by the name of add_number with 2 parameters of type integer.  Same goes in case of adding or concatenating 2 strings, you can

Params Parameter Modifier in C# with Example

An another parameter modifier is params keyword.  Like out and ref parameter modifier in C#, we have to use it in method declaration, but we don’t need to use params keyword while passing the method arguments.  Params keyword is only used in front of arrays and it should be the last parameter in your method

Out Parameter Modifier in C# with Example

An another parameter modifier is out, which we use when we are expecting more than 1 output from a method.  Normally, a method return only 1 type of value depending upon the return data type like string, int, array etc.  In this case, you can create multiple variables of different data types to store the