Using C#, lets say I have these classes:
classZero
classOne
classTwo
class classZero and classOne have a public function named "Hello()".
how can i creat a new function (in any class) that takes a unknown class as a paramenter and then run the function "Hello" on this unknown class, if it exists?
in sebdo code this would look something like this:
function runHelloIfPossible(anyclass aclass):
if aclass contains function Hello:
aclass.Hello()
if in my case the anyclass argument where any of classZero or classOne the function Hello would run.