The second fundamental principle of Object Oriented Programming is called encapsulation. Its main definition refers to the action of hiding anything that is not essential from the outside world. It is not very difficult to understand the fact that we do not need to expose everything when we build something.… Read more
Archive for 2019
Encapsulation
Thursday, December 19th, 2019Virtual Methods
Sunday, December 8th, 2019Virtual methods are methods that can be overridden in inheriting (derived) classes. By default, in .NET, methods are not virtual. In order to declare a method as virtual, we need to declare it using the keyword virtual, like so:
Inheritance
Sunday, November 17th, 2019In the first lesson of the Objects chapter, I was discussing in a broad way about Object Oriented Programming, acronymed OOP, and I was enumerating it’s fundamental principles: encapsulation, inheritance, abstraction and polymorphism. In this lesson, I will explain inheritance at large, and how class hierarchies improve code readability and reusability.… Read more