G
Guest
Hello all,
I have an object of type B that inherits from an object of type A.
I create a new instace of B, but I need to cast/convert it to an object of
type A in order to call a particular method. I've tried all sorts of ways to
cast it as A but it always stays as an object of type B. The below is an
example of the code I've tried:
A a = B.Create();
A a = b as A;
No matter what I do, it always stays as B!!
Can anyone offer any help?
Thanks,
Jon
I have an object of type B that inherits from an object of type A.
I create a new instace of B, but I need to cast/convert it to an object of
type A in order to call a particular method. I've tried all sorts of ways to
cast it as A but it always stays as an object of type B. The below is an
example of the code I've tried:
A a = B.Create();
A a = b as A;
No matter what I do, it always stays as B!!
Can anyone offer any help?
Thanks,
Jon