Author: Luay Younus Version: 1.0
The main four principles in OOP are:
- Inheritance
- Abstraction
- Polymorphism
- Encapsulation
They are explained in a console application with comments and examples.
- Visual Studio 2017 Community with .NET Core 2.0 SDK
- GitBash / Terminal or GitHub Extension for Visual Studio
- Clone the repository to your local machine.
- Cd into the application directory where the
AppName.sln
exist. - Open the application using
Open/Start AppName.sln
.
abstract
classes can Not be instantiatedoverride
keyword is used on methods that are already declared abstract in abstract classes; overriding methods means implementing themsealed
keyword can be used on overridden methods to make them final from being re-overridden:
next to the class name indicates inheritance from the class on the right side of the colon- Access modifiers are
public
private
internal
protected
protected internal
, they have to be used correctly and in accordance to keep consistency - Main class is called
base
indicatingparent
- Inherited class is called
derived
indicatingchild
- C# Console Core application
- Base/Parent class is Zoo, Safari and Aquaria are the first two derived Classes