4Object-Oriented Programming with C#

OBJECT ORIENTATION

C# is not a pure object-oriented programming language. C# offers multiple programming paradigms. However, object orientation is an important concept with C#, and it’s a core principle of all the libraries offered by .NET.

The three most important concepts of object-orientation are inheritance, encapsulation, and polymorphism. Chapter 3, “Objects and Types,” talks about creating individual classes to arrange properties, methods, and fields. When members of a type are declared private, they cannot be accessed from the outside. They are encapsulated within the type. This chapter’s focus is on inheritance and polymorphism.

The previous chapter also explains that all classes ultimately derive from the class System.Object. This chapter covers how to create a hierarchy of classes and how polymorphism works with C#. It also describes all the C# keywords related to inheritance.

TYPES OF INHERITANCE

Let’s ...

Get Professional C# 7 and .NET Core 2.0, 7th Edition 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.