I am working on webservices with spring DI. I am using the Eclipse IDE and have written a validator. I am testing the code in SoapUI. The question is I have a validator class UpdateRequestValidator which is extending another interface IValidator which has a method validate() and therefore the UpdateRequestValidator class is implementing the validate() method. This method is being called from an endpoint adadpter class. I am using an annotation @Override before validate() method in UpdateRequestValidator class. The validator is working fine with or without the @Override annotation.
Now the question is that what role is this annotation playing here, and is there any side-effect if i remove it because the code and validator is working perfectly well after removing it.
The @Override is just a “tag” telling the compiler that that metode overrides another methode.
Removing @Override would not change anything but if you remove the validate() methode in the parent class and still have the override notation you’ll get a compile time error