M
Magennis Weate
I am really missing something here:
·I Have two unrelated objects X and Y
·These two objects share some of the same method calls
I want to write just one function that I can pass either X or Y to
which will then call methods on the object. I don't want to use
polymorphism as the handling of the object will be exactly the same –
so I should be able to use just one function for both objects.
I have tried declaring the parameter of the function as "object" but
then when I call the methods on this parameter variable the language
complains that "object" does not have this method.
Thanks.
·I Have two unrelated objects X and Y
·These two objects share some of the same method calls
I want to write just one function that I can pass either X or Y to
which will then call methods on the object. I don't want to use
polymorphism as the handling of the object will be exactly the same –
so I should be able to use just one function for both objects.
I have tried declaring the parameter of the function as "object" but
then when I call the methods on this parameter variable the language
complains that "object" does not have this method.
Thanks.