java – @Override on Implementation
Will you put comments in the implementation class methods? Is it useful? If you input wrong or no input, it is a compilation error anyway
Solution
I assume you are asking about annotation methods defined in the implemented interface, or abstract methods in superclasses In this case, you are correct. Spelling errors in the method signature will lead to compilation errors, whether there is @ override However, I think annotations still help to explicitly mark methods as implementing interfaces If the interface changes, using the @ override annotation on all implementation methods can help determine which method signatures have changed and need to be updated
@H_ 502_ 12@
More importantly, as mklhmnn mentioned in his answer, if a method is deleted from the interface, the @ override annotation in the implementation class will lead to compilation errors Without comments, you may not realize that a method has been deleted from the interface, which may lead to subtle errors@ H_ 502_ 12@