Object-Oriented Programming

C-Sharp supports every basic principle of OOPAbstraction, Encapsulation, Inheritance, Polymorphism —.

Abstraction

This is the process of hiding complex details and tasks and exposing only a simple interface for interaction between the user and the complex features, often as a function or method.

Encapsulation

This is the mechanism of restricting access to data and parts of the code. Each object should control its own data, methods, and properties. Think about what really needs to be exposed and what should be kept private.

One way to do this in C# is to use private fields and manage with properties.

Inheritance

For inheritance, check the note Inheritance in C-Sharp

Polymorphism

Polymorphism means “the condition of occurring in several different forms”. So types in the same inheritance chain should be able to perform different tasks. So children objects share functionality, but it’s also able to define its own implementations.

-------- WIP--------