Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Main()
- {
- Sub s = new Sub();
- Base b = s;
- s.MyProperty = 1;
- b.MyProperty = 2;
- Console.WriteLine(s.MyProperty);
- }
- public class Base
- {
- public int MyProperty { get; set; }
- }
- public class Sub : Base
- {
- private new int MyProperty { get; set; }
- }
Add Comment
Please, Sign In to add comment