Following code giving an error near the public void control() {.
EClipse giives a tip to remove the @Override annotation also. I went throudh the docs.oracle and found that If a method marked with @Override fails to correctly override a method in one of its superclasses, the compiler generates an error.
I don’t understand what is meaning of “fails to correctly override”?
public class PersistenceFlowController implements controllers.FlowController {
@Override
public void control() {
// Do some works here
}
}
package controllers;
public interface FlowController {
void control();
}
In JDK 1.5,
@Overridecould be applied only to methods from a parent class. In JDK 1.6 and up, it can be used for interface methods, too. My guess is that you have Eclipse set for JDK 1.5 compiler compliance. You can check or change this in the “Java Compiler” tab of the project properties dialog.