Class property override in C#
Forums:
class Shape {
public virtual int LineCount {
get { return 0; }
}
}
class Square : Shape {
public override int LineCount {
get { return 4; }
}
}
var square = new Square();
//square.LineCount is 4
- Log in to post comments