fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. new Child();
  8. }
  9. }
  10.  
  11. class Parent
  12. {
  13. public Parent()
  14. {
  15. DoSomething();
  16. }
  17.  
  18. protected virtual void DoSomething()
  19. {
  20. }
  21. }
  22.  
  23. class Child : Parent
  24. {
  25. private string foo = "FOO";
  26.  
  27. protected override void DoSomething()
  28. {
  29. Console.WriteLine(foo.ToLower());
  30. }
  31. }
Success #stdin #stdout 0.01s 131648KB
stdin
Standard input is empty
stdout
foo