Hello, in this video we are going to cover interfaces. So we've done classes where we have a vehicle class, and a car class, they inherit from it using the keyword extends. And we can have another class that inherits from this on as well. But if let's say, let me show you, I'll get rid of all of this code. And Armando, let's say just have a general blueprint structure, you know, that vehicle, you probably wouldn't create objects of that vehicle, what you essentially want is like an interface, an interface. And this is especially useful if you do not want the functions of the interface or you know, the class to have its own, you know, definition of, you know, its own implementation, and it's implemented in child classes, but you want to have the same name.
So interfaces are great for this vehicle and curly braces and I was putting out a public function. And then obviously you can change this if you need to protect them private, I'm going to say vehicle on. So for this, move forward and I'll just do you know for function move forward, move left, move forward and move back. left and right and steer. I do one call that move left and right literally where the wheels turn 90 degrees, and then there's to be easier for car parking and just maneuverability in general. But I digress.
And okay, I'm gonna go to now you create a class and we're going to say call for example, instead of extending it you put implements the interface. And let's see what we get if we run this, so we get an error. It sends two abstract methods, which are these that haven't been implemented, so we have to implement them, so we can copy them from paste them here. And that error should disappear. Exactly put something inside like echo. I am moving forward, yay brake line just for formatting purposes.
And now, we can actually create an object of this class focus $1 call OBJ equals new call. And this call class can have no functionality like constructors, destructors variables, and all the other functionality there are that you are used to with classes as well. And now, let me just call one of the methods on each call. One of them to demonstrate this. So move forward. And if we're on that, yet, I am moving forward, yay.
So if we created another class, for example, class boy, and we did implement vehicle, again, we are going again, error, because we have not implemented these two methods. So let's implement them. And for this, I'm gonna say, I only put a forward and backwards to this one. So as you can see, they have their own unique implementation for each function. And this is different to function overriding, because this cannot have its own function implementation. And it forces you to have your own function implementation per class.
So this is, you know, great in those scenarios. So that's it. A interface. If you have any questions, feel free to shoot me a message and as usual, I look forward to seeing you in the next video.