‫Welcome back.
‫In this video, it's all about inheritance and in this chapter in general.
‫And we are going to have a look at the definition first and then we'll see an example.
‫And in the next videos we're going to get into demo.
‫So first of all, a definition inheritance allows us to define a class in terms of another class, which
‫makes it easier to create and maintain an application.
‫This also provides an opportunity to reuse the code functionality and speed up implementation time.
‫So that means that we can create classes and we've seen that already and we can take those classes and
‫their functionality and methods and then reuse that and simply add on top of that without adjusting
‫the class itself so we can inherit from that class and use additional functionality and additional properties
‫and those kind of things.
‫And that allows us to have a much more maintainable code that is easier to maintain in the future.
‫And it really makes sense as soon as the programs get or the applications get a lot more complex.
‫And it also speeds up implementation time because you don't have to copy and paste a lot of code or
‫write code once again and again.
‫But you can simply take that from the other class or inherit the other class and use its functionality.
‫And that's something that we can not only do with classes that we create ourself, but we can use the
‫ones that are in the libraries that we use.
‫So we can simply import libraries and then use those.
‫And that's amazing.
‫So let's have a look at inheritance, for example, a car.
‫So a car is the base class and that can be inherited from so there is a deriving class, for example,
‫race car and street car and, and here the car has some properties and some methods and they are true
‫for every car.
‫So every car has horsepower, every car has windows, every car is an amount of wheels.
‫And at the same time they also have a method.
‫So every car should drive and I guess every car should be able to honk.
‫And those are properties and methods which are true for all cars.
‫So a race car has those things as well.
‫But on top of that, it has a property, for example, it has a turbo which allows it to drive faster.
‫Then it has the method racing, so it allows them to race in general on the racing pit, maybe it's
‫not allowed to drive on a street.
‫On the other hand, a street car may do that.
‫So it has the method street, right.
‫And the property comfort.
‫Well, in this example, the comfort is limited maybe, but generally that's how you could see it.
‫And you can extend that by a lot.
‫And it's not just cars and and in the next slide, employees, it's pretty much everything.
‫So you can see that on phones, a phone can be inherited.
‫And for example, a smartphone is a phone.
‫So it has the capabilities of a phone, but at the same time it has some additional capabilities.
‫But now let's have a look at employees.
‫So another example, we have an employee which is the base class, and it has properties such as salary
‫work hours and plenty more.
‫And then methods the methods are do the job, get to work, get paid.
‫So that's pretty much it.
‫And then there's a lot more of course.
‫And then we have deriving classes, for example, the designer.
‫A designer has the property of years of design experience, then level of creativity and a lot more.
‫And the methods, for example, design and draw stuff.
‫The engineer, on the other hand, is also deriving class and has properties such as years of a programming
‫experience or a level of sarcasm and then methods, design and program.
‫And you see here design is true for the designer and the engineer, but even though they are the same
‫in both cases, they are not true for every employee.
‫So not every employee needs to design something.
‫That's why they even though they are pretty much copying methods from the two, they could still be
‫different.
‫So a design method in engineer could be different to the design method in the designer.
‫But the employee itself doesn't need to design and only those driving classes need those methods.
‫So let's just some examples on a theoretical level.
‫We will look into that in a demo in the next video.
‫And not just that, we will have plenty of examples.
‫So no worries if that's not enough for you to grasp the whole concept.
‫We will look into all the different aspects of inheritance.
‫Yeah.
‫So let's go to the next video and get started.