@Override was introduced by JDK5 and is described as follows:
Indicates that a method declaration is intended to override a method declaration in a superclass . If a method is annotated with this annotation type but does not override a superclass method, compilers are required to generate an error message.
The description in the JDK6 documentation is exactly the same! But the real trouble lies in the understanding of superclass ! JDK5 believes that Override overload is to override the method of the parent class, while JDK6 defines both the method of overriding the parent class and the method of implementing the interface as Override superclass. Therefore, as long as @Override is written in the place where the interface method is implemented, JDK5 will report an error
I personally feel that @Override of JDK5 may be a design bug:) Because I feel that the understanding of JDK6 is relatively correct.
Third, the method to modify the error caused by @override in the Myeclipse environment
- JAVA: How to Solve @override error
- How to Solve JAVA @override error
- Access permission problem caused by object. Clone() method
- How to Solve Error starting modern compiler
- The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class
- Solve the error reported by eclipse project: unbound classpath container
- JSP Web Error:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- Eclipse Error:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- How to Solve Intellij IDEA Warning:@Override is not allowed when implementing interface method