Luke

Luke

  • NA
  • 13
  • 0

Inheritance of class properties

May 16 2008 7:06 PM

I'm trying to figure out how to override the value of a propery for a parent class in a child class.

For example, i have

   public class Base

   { public virtual string _Caption="parentresult";}

   public class Child

   { public override string _Caption="childresult";}

But the virtual and override keywords raise errors during compilation.  They work if i setup accessors, but I shouldn't have to do that (should I?).

Is it possible to make them consts, also?


Answers (1)