Finished Defining an Abstract Class, repo at 1b38d89

Jason Zhu 2021-02-22 23:26:20 +11:00
parent fbdaf84877
commit 93735d8878

@ -65,4 +65,18 @@ This class has methods:
* `GetHashCode()`
* ...
All these methods will be inherited in its derived class (i.e. all classes)
All these methods will be inherited in its derived class (i.e. all classes)
## Setting up a Scenario & Defining and Abstract Class
Reference:
* [Abstract and Sealed Classes and Class Members (C# Programming Guide)](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/abstract-and-sealed-classes-and-class-members#abstract-classes-and-class-members)
* [Abstract Class and Abstract Methods in C# (dotnettutorials.net)](https://dotnettutorials.net/lesson/abstract-class-abstract-methods-csharp/)
* [Polymorphism in C# (dotnettutorials.net)](https://dotnettutorials.net/lesson/polymorphism-csharp/)
> vehicle is something that has various forms; two-wheeler, three-wheeler and four-wheeler and so on. So this is one example of polymorphism.
> Technically we can say that when a function shows different behaviors when we passed different types and number values, then it is called polymorphism. So behaving in different ways depending on the input received is known as polymorphism i.e. whenever the input changes, automatically the output or the behavior also changes.
Abstract class is prerequist of polymorphism
TODO: Understand polymorphism more deeply.