It ensures that the method is actually overriding a superclass method, helping to catch errors.
The @Override annotation is used to indicate that a method is intended to override a method in a superclass. This helps the compiler catch errors if the method signature doesn't match any method in the superclass. For example, if you accidentally misspell the method name, the compiler will alert you, reducing bugs and making the codebase clearer.