Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Derived classes of abstract class share property

abstract class A
{
    public abstract string X
    {
        get;
    }
}

class A1 : A
{
    public override string X
    {
        get { return "A1"; }
    }
}

class A2 : A
{
    public override string X
    {
        get { return "A2"; }
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Derived #classes #abstract #class #share #property
ADD COMMENT
Topic
Name
6+9 =