When changing the eclipse compiling environment from JDK 6 to JDK 5 many times, almost all @ override writes under JDK 6 will report errors. Think twice about it.
I found the cause on the Internet :)
@ Override is introduced by JDK 5 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 descriptions in JDK 6 are exactly the same! But the real trouble lies in the understanding of superclass! JDK 5 considers override overload to overwrite the parent class method, while JDK 6 defines both the parent class method and the implementation interface method as override superclass. Therefore, as long as @ override is written to implement the interface method, jdk5 will report an error.
I personally think that the @ override of JDK 5 may be a bug during design. :) it seems that JDK 6 has a correct understanding.