Chapter 4: Understanding the Various User-Defined Types

In the previous chapter, we learned about control statements and exceptions in C#. In this chapter, we will explore the user-defined types in C#. We will learn how to create custom user types using classes, structures, and enumerations. We will explore what fields, properties, methods, indexers, and constructors are in a class. We will study the access modifiers in C# and learn how to use them to define the visibility of types and members. We will also learn about two important keywords in C#—this and static—and understand the ref, in, and out parameter modifiers for methods.

We will explore the following topics in detail:

  • Classes and objects
  • Structures
  • Enumerations
  • Namespaces

Good knowledge ...

Get Learn C# Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.