Summary
In this chapter, we have learned about the user-defined types in C#. We learned about classes and structures that help us to create custom user types in C#. We also learned how to create and use fields, properties, methods, indexers, and constructors inside a class, and we learned about the this
and static
keywords.
We explored the concepts of access modifiers and understood how we can define various levels of access to types and members. We also learned about ref
, in
, and out
parameter modifiers, as well as methods with a variable number of arguments. Last but not least, we learned about namespace and how to use them to organize code and avoid name collisions.
In the next chapter, we will learn about Object-Oriented Programming (OOP) concepts. We will explore the building blocks of OOP—encapsulation, inheritance, polymorphism, and abstraction. We will also learn about abstract classes and interfaces.