Recently I have been playing with Structure and it is fun. I have written couple of blog post about structure. Following are links for that.
Structure in C#
Structure with constructor in C#
In this blog post we are going to learn how we can use structure with interface. So like earlier example I’ve created a console application. Now it’s time to write interface which we can implement with structure. Following is a code for that.
Structure in C#
Structure with constructor in C#
In this blog post we are going to learn how we can use structure with interface. So like earlier example I’ve created a console application. Now it’s time to write interface which we can implement with structure. Following is a code for that.
using System; namespace StructureWithMethodAndInterface { interface IPrintable { void Print(); } }Here you can see that I have simple interface IPrintable which has simple print method. Now let’s create a structure which implement this interface. Following is a code for that.