ELI5: Explain Like I'm 5

Inheritance (object-oriented programming)

Inheritance is a way of making code reusable in object-oriented programming. It lets you create new classes (a collection of code) that use code that was written in another class. Imagine you have a car and a truck. They may have some things in common like wheels and doors, so you can create a 'Vehicle' class that contains code that applies to both cars and trucks. Then you can create separate 'Car' and 'Truck' classes that inherit the 'Vehicle' class. This means that both the 'Car' and 'Truck' classes will have all the code from the 'Vehicle' class, while the 'Car' class might have extra code that only applies to cars, like a radio, and the 'Truck' class might have extra code that only applies to trucks, like a bigger engine. In other words, it lets you reuse code from one class in many others.