Lesson 23: Working with Nullable Types

Working with value types and data can sometimes be challenging because a value type doesn’t normally hold a null value. This lesson shows you how to overcome this limitation with C# nullable types. Here’s what you’ll learn. Understand the problem that nullable types solve See how to declare a nullable type Learn how to use … Continue reading “Lesson 23: Working with Nullable Types”

Lesson 22: Topics on C# Type

Throughout this tutorial, you’ve seen many different types, including those that are part of C# and custom designed types. If you’ve taken the samples and worked on them yourself, extending and writing your own programs, you are likely to have experienced errors associated with type. For example, you can’t assign a double to an int … Continue reading “Lesson 22: Topics on C# Type”

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”