I think you have something like this:
class A
{
public void Foo() { }
}
class B : A
{
}
and you need to decide between:
B b = new B();
b.Foo();
and
B b = new B();
((A)b).Foo();
Both work. But casting is not required because it Binherits all members from A.
source
share