Hello,
How can I return an object of the inherited class B from within class A ?
How can I return an object of the inherited class B from within class A ?
C#:
public class B
{
//properties of class B
//methods of class B
}
public class A : B
{
public A ()
{
//constructor fills properties of class A and properties of inherited class B with values.
}
public B Get()
{
//How can I return an obj that only represents the inhereted class B
return obj;
}
}