I see a lot of questions like what is/ what does “@override” do?
Your code does not require @override to work correctly. @override It is something the compiler uses to help you. You are telling the compiler that you are overriding a method/function in the class you are inheriting from. Why is it useful to do this?. Well once the compiler knows that you intend to override it can help you identify errors in your code.
For example, let us say you have inherited from a class called Person. It has a method getName().
Now in your inherited class you mistype getName() as getname().
Without the @override statement the compiler will be happy.
However you with @override you will get an error because the compiler will not find a method in the parent class called getname() because you mistyped it. The compiler will point this out to you. So @override helps.. 🙂