How to have abstract and overriding constants in C# ?

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-03-09T05:23:15Z Indexed on 2010/03/09 5:36 UTC
Read the original article Hit count: 290

Filed under:
|
|

Hi all, My code below won't compile. What am i doing wrong? I'm basically trying to have a public constant that is overridden in the base class.

public abstract class MyBaseClass
{
  public abstract const string bank = "???";
}

public class SomeBankClass : MyBaseClass
{
  public override const string bank = "Some Bank";
}

Thanks as always for being so helpful!

© Stack Overflow or respective owner

Related posts about c#

Related posts about constants