I have a parent class with several children. One of the children, has one overridden method that, for its particular internal usage, needs one more parameter. I don't want to change the method's signature because the overridden method in the other children does not need this parameter, also, I don't want to add a class property because it is pointless in this case.
How do you deal with these situations?
So far I've added a NotImplementedException in the method and created a new one, but it really is something I've done while I wait for an answer, I don't want to do it this way.
Edit after Jon Skeet's answer
I'll try to figure out if I've understood what Jon suggested. This is quite interesting.
public abstract class Parent {
public abstract void aMethod(Object parameter);
}
public class NotReallyParentChild {
public Parent createInstance(){
return new Child();
}
}
public abstract class Child extends Parent {
}
Mmmmh no I'm completely wrong here, I don't understand the second part of your post, could you please shed some light on this?