3 Books about Inheritance and Polymorphism [PDF]
October 05, 2025 | Author: Maria Lin
Programmers are very lazy people, so they don't want to write the same code several times. That's why they invented Inheritance and Polymorphism.
For example, let's say we're creating a game like The Sims. We have a lot of people there and they're all different, but they all have two arms, two legs, one head and they all walk the same way and drink water from a cup. To avoid coding all these parameters and methods for each character separately, we can create a class Person containing all the universal features. Then we can create classes Man, Woman, Boy, Girl - describing only the specific features of these characters. This is called Inheritance.
With inheritance, the child-class already has all the methods of the parent-class. We can add new methods to it and sometimes we can even override parent methods (if the child class is different from the others). For example, the Grandma class walks with a cane, unlike Man, Woman, Boy and Girl, so we'll override the Walk method for it.
When we click on any character, a menu appears with various functions we can perform on that character: Say..., Eat, Go to the WC, etc. And we want this set of functions to be the same, regardless of which character we click (otherwise we'll get confused). And the programmer, who is coding this menu wants the same! They don't want to write separate Eat functions for Man, Woman and others. Therefore, programming languages allow to create functions that can work with objects of different classes, if these objects behave similarly, respond to the same commands (i.e., have the same parameter and method names). This is called Polymorphism. And objects that behave similarly are called polymorphic.
Here are some PDF books about Inheritance and Polymorphism:
Object Oriented Programming
2020 by Anuradha A. Puntambekar

Download PDF
Sams Teach Yourself Object Oriented Programming in 21 Days
2001 by Anthony Sintes, Tony Sintes

Download PDF
Object Oriented and Multicore Programming
2020 by Anuradha A. Puntambekar

Download PDF
How to download PDF:
1. Install Gooreader
2. Enter Book ID to the search box and press Enter
3. Click "Download Book" icon and select PDF*
* - note that for yellow books only preview pages are downloaded
For example, let's say we're creating a game like The Sims. We have a lot of people there and they're all different, but they all have two arms, two legs, one head and they all walk the same way and drink water from a cup. To avoid coding all these parameters and methods for each character separately, we can create a class Person containing all the universal features. Then we can create classes Man, Woman, Boy, Girl - describing only the specific features of these characters. This is called Inheritance.
With inheritance, the child-class already has all the methods of the parent-class. We can add new methods to it and sometimes we can even override parent methods (if the child class is different from the others). For example, the Grandma class walks with a cane, unlike Man, Woman, Boy and Girl, so we'll override the Walk method for it.
When we click on any character, a menu appears with various functions we can perform on that character: Say..., Eat, Go to the WC, etc. And we want this set of functions to be the same, regardless of which character we click (otherwise we'll get confused). And the programmer, who is coding this menu wants the same! They don't want to write separate Eat functions for Man, Woman and others. Therefore, programming languages allow to create functions that can work with objects of different classes, if these objects behave similarly, respond to the same commands (i.e., have the same parameter and method names). This is called Polymorphism. And objects that behave similarly are called polymorphic.
Here are some PDF books about Inheritance and Polymorphism:
Object Oriented Programming
2020 by Anuradha A. Puntambekar

Download PDF
Sams Teach Yourself Object Oriented Programming in 21 Days
2001 by Anthony Sintes, Tony Sintes

Download PDF
Object Oriented and Multicore Programming
2020 by Anuradha A. Puntambekar

Download PDF
How to download PDF:
1. Install Gooreader
2. Enter Book ID to the search box and press Enter
3. Click "Download Book" icon and select PDF*
* - note that for yellow books only preview pages are downloaded