fork download
  1. using System;
  2.  
  3. class A {
  4. public virtual int test {
  5. get {return 7;}
  6. }
  7. }
  8.  
  9. class B : A {
  10. public override int test {
  11. get {return 8;}
  12. }
  13. }
  14.  
  15. public class Test
  16. {
  17. static void Main(string[] args)
  18. {
  19. A test1 = new A();
  20. A test2 = new B();
  21.  
  22. Console.WriteLine(test1.test);
  23. Console.WriteLine(test2.test);
  24.  
  25. }
  26. }
Success #stdin #stdout 0.03s 33880KB
stdin
Standard input is empty
stdout
7
8