Lesson 21: Anonymous Methods

In Lesson 14: Introduction to Delegates, you learned about delegates and how they enable you to connect handlers to events. For C# v2.0, there is a new language feature, called anonymous methods, that are similar to delegates, but require less code. While you learn about anonymous methods, we’ll cover the following objectives: Understand the benefits … Continue reading “Lesson 21: Anonymous Methods”

Lesson 20: Introduction to Generic Collections

All the way back in Lesson 02, you learned about arrays and how they allow you to add and retrieve a collection of objects. Arrays are good for many tasks, but C# v2.0 introduced a new feature called generics. Among many benefits, one huge benefit is that generics allow us to create collections that allow … Continue reading “Lesson 20: Introduction to Generic Collections”

Lesson 19: Encapsulation

Earlier in this tutorial, you learned about two of the important principles of object-oriented programming, Inheritance and Polymorphism. Now that you’ve seen much of the syntax of C#, I’ll show you how C# supports the another of the object-oriented principles – Encapsulation. This lesson will discuss Encapsulation with the following objectives: Understand the object-oriented principle … Continue reading “Lesson 19: Encapsulation”

Lesson 18: Overloading Operators

This lesson shows you how to overload C# operators. Our objectives are as follows: Understand what operator overloading is Determine when it is appropriate to overload an operator Learn how to overload an operator Familiarize yourself with rules for operator overloading About Operator Overloading In Lesson 2, you learned what operators were available in C#, … Continue reading “Lesson 18: Overloading Operators”