Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class A
- {
- int value = 5;
- public int prop
- {
- get { return value; }
- set { this.value = value; }
- }
- }
- class B : A
- {
- public B()
- {
- prop = 10;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- A myclass = new B();
- Console.WriteLine(myclass.prop);
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment