Explicit Interface Implementation in C# with Example

We know how interface works in C#.  But in some cases, we encounter a situation where 2 interfaces have a method of same name and signature.  Since your class or structure can inherit from multiple interfaces, there will be ambiguity about which method you want to call.  To resolve this issue, we make use of

Interface in C# with Example

Interface is an another important pillar of object oriented programming.  An interface only contains declaration of its members like properties, methods, delegates, and events, but not fields.  Make sure, you should not provide implementation for any of its member inside the interface.  To create an interface, we make use of interface keyword.  By common naming

Object Initializer in C# with Example

We have seen how properties work in C#.  To assign values to properties, we create an instance of the class and assign them one by one in every new line.  To simplify this process, we make use of Object Initializer.  Object Initializer was introduced in C# 3.0 and it will definitely save your a lot

Difference Between Structure and Class in C#

We have seen how a class and a structure work.  They are pretty much similar in their functionality, but there are also certain differences between them.  The 5 important differences are given below. A structure is of value type and a class is of reference type. A class can have a destructor, but a structure