In today’s tutorial, we are going to make a simple address book in C#. We will see how to create lists and arrays and use them in a real world application such as this simple address book. I am also going to be trying something new with this tutorial where I am asking you to implement what is missing. [Read more…]
In this tutorial, I will show you how to create a simple change calculator in C# using Visual Studio. I will show you how to take any dollar amount and calculate exactly how many bills and coins to give back. By the end of this tutorial, you will be able to run your change calculator and calculate the bills and coins (in US dollars) that amount equals. [Read more…]
In this article, we will see what generics are, what problem they solve, what are generic classes, what are generic methods and what are generic collections. [Read more…]
In some of my most recent articles, we saw what inheritance, polymorphism, and interfaces are and how they are implemented in C#. In this article, we will discuss another important C# concept. We take a look at what extension methods are, how they are used, and how can we implement them in C#. [Read more…]
In a previous article, I explained inheritance in C#. We studied how to implement inheritance between classes. In all of the examples in that article, we performed single inheritance. Single inheritance refers to the idea of inheriting from one class. In C# a child class can only have one parent class. However, a parent class can have many child classes. A child class can have many levels of parent class but it has only one immediate parent. But what if you want a class to inherit from multiple classes? Suppose you have a class “Mechatronics” and you want this class to inherit from both “Mechanics” and ‘Electronics” classes. In C# you CANNOT do so. This is where interfaces come handy. In C# you can implement multiple inheritance via interfaces. In this article, we will study interfaces in detail.