Below is a very simple code in Java.
The problem is in the class SC as comments shows. The problem can be easily fixed by removing the final modifier in class C, but it will raise a warning in Checkstyle plugin saying Method 'm' is not designed for extension - needs to be abstract, final or empty.
What is the best design practice here that I should follow?
public interface I {
public void m();
}
public class C implements I {
@Override
public final void m() {
// some code
}
}
public class SC extends C {
@Override
public final void m(){
// error message saying "Cannot override the final method from C"
}
}