C
Craig L. Taylor
I'm trying to extend from a class that has the following method in it:
abstract void setValue(int v);
But, instead of forcing a child class to have int v as an argument, I would
like the child to have the possibility to be able to declare a double as
well. Is there a way to have a parent say "If you inherit from me, you must
implement one of these two methods to work", like this:
// Child class must implement one of these
abstract void setValue(int v);
abstract void setValue(double v);
abstract void setValue(int v);
But, instead of forcing a child class to have int v as an argument, I would
like the child to have the possibility to be able to declare a double as
well. Is there a way to have a parent say "If you inherit from me, you must
implement one of these two methods to work", like this:
// Child class must implement one of these
abstract void setValue(int v);
abstract void setValue(double v);