First, I am expanding the existing class structure and cannot change the original with this warning:
I would like to do this:
class a
{
int val;
...
public int displayAlteredValue(int inp)
{
return (val*inp);
}
}
class b extends a
{
...
public in displayAlteredValue(int inp1, int inp2)
{
return (val*inp1*inp2);
}
}
As I said, I cannot change class a, and I want to save the name of the function displayAlteredValueinstead of creating a new function. If this can be done, I need to change multiple instances ato instances b. I do not want to spend a lot of time replacing many function calls with displayAlteredValue. (And yes, I understand that there are things like search and replace, but for other reasons, as this will be problematic).
Any ideas?
Zed
source
share