Override differences in Java 5 and Java 6

Sometimes you might be struggling with such error shown, e.g. in Eclipse: The method … must override a superclass method. If this error is shown in the line when you have your interface method implementation with @Override annotation, it most probably means that you’re using JDK 5 instead of JDK 6. In Java 5, the @Override annotation might be applied only to the methods overriding superclass ones. Since Java 6 you can use the @Override annotation also with the methods that implements the interface ones....

February 28, 2012 · 1 min