abstract class Parent
{
protected string attrParent;
public AttrParent { get; protected set }
public Parent(string sParent)
{
A parent
instance can only access methods avaliable in the parent
class, If you want to access the child
methods you need to create a child
class. The problem if that you are trying to access the child
methods from the parent
class.
With inheritance if you wish to call methods in the child
class you will need to make a new instance of child
class. The purpose of that a parent
can have multiple child
classes inheriting from it and if the code in your example worked then it would cause problems when a parent
has multiple child
classes.