I have an Interface and two Classes which are implementing the Interface.
public interface MyInterface {
public void firstMethod();
public int secondMethod();
}
public class MyClass1 implements MyInterface {
public void firstMethod() {}
}
public class MyClass2 implements MyInterface {
public void firstMethod() {}
public int secondMethod() {}
}
The class MyClass1 is telling me to Add unimplemented methods, because the secondMethod is not implemented, OK I will do that. But the problem is that I don't need this method in MyClass1.
In your opinion what is the best thing to do?
- Add the unimplemented method with something like
return 0 - There is another way to fix this if I don't want to implement it.