Hello, in this video we are going to take a look at abstract classes. So an abstract class is one that cannot be instantiated because this class called vehicle, I have a class called call that inherits from it using the extends keyword, but I could create an object of vehicle, but maybe, and I think this is, you know, logical that you can really just have a vehicle, you know, you'd be able to a certain type of vehicle, it could be a car, could be a could be a bike could be something a plane, it, you know, it's a type of vehicle, not just a vehicle in itself. So we can make this abstract. So the developer cannot, you know, also the developer, someone else on our team can't instantiate aka, make an object of like this. So what we have here, and let me just show you that you can create an object even though you know shown in previous video, but want to make sure that you sign up for this vehicle obj equals new useful and we know we've got a bunch of extra printf but as you can see we don't want the errors to actually make this abstract you put the keyword obstruct from Tibet and you put obstruct in front of everything else there there the don't need a construct to them because because because because we cannot create something of it we do not need a disruptive and Eva I don't see Oh yeah, so okay props cannot be declared my bad we can get rid of these cannot contain body There we go Capricorn out the public key not contained buddy.
Oh, my bad. They need to get they calm. What we need to do is this. We need to put this looking at still. Hmm strange looking data because of that let me make sure I've got the abstract function, print all info looks all right to me Extract the knowledge to the class. And it's because of this because the arrows on line nine range message that functions well.
We're about to do the not to do lists, PHP function address. just reload are up there. There we go. Class contains Yeah, that's fine. That is fine. So what we need to do is, is implemented the print on info and forward method by put in public function and then print on info.
And then we need one for the move forward as well move forward. And there we go. So the move forward doesn't do anything. And the print on info doesn't do anything, either we're not recording the methods, but they don't do anything yet, because we've got no code in there. So you can even bring the code over that we had before. implement more specific code.
You know, it's really that simple as all you have to do. And yes, that's what you would want to use an abstract class is where you not only cannot do this show you Can't do they get an error, because you can't create an instance of that class aka an object. So it forces you to create a child if you want to utilize it. There's basically like a blueprint skeleton. It's sort of, you know, going to be a bit beyond what a interface. So if your regular class doesn't quota, and interface isn't quoted, then you probably might want to use some sort of abstract class in there.
And that's it. If you have any questions, feel free to pop me a message. And as usual, I look forward to seeing you in the next video.