Why is it impossible to override a getter-only property and add a setter?
Posted
by ripper234
on Stack Overflow
See other posts from Stack Overflow
or by ripper234
Published on 2008-09-17T12:14:04Z
Indexed on
2010/04/03
12:13 UTC
Read the original article
Hit count: 166
Why do you think (or, why is it good that) Microsoft chose not to allow:
public abstract class BaseClass
{
public abstract int Bar { get;}
}
public class ConcreteClass : BaseClass
{
public override int Bar
{
get { return 0; }
set {}
}
}
© Stack Overflow or respective owner