C
csharpula csharp
Hello,
I have 3 classes: classA,classB,classC. B and C inherit from A.
I want to prefer the following operation on a list of classA objects
(which can be from type classA,classB or classC) - let's refer to it as
listA.
foreach (classB bObjects in listA)
{
}
Is that possible to fetch only the B objects from the general list?
Thanks!
I have 3 classes: classA,classB,classC. B and C inherit from A.
I want to prefer the following operation on a list of classA objects
(which can be from type classA,classB or classC) - let's refer to it as
listA.
foreach (classB bObjects in listA)
{
}
Is that possible to fetch only the B objects from the general list?
Thanks!