Guest User

Untitled

a guest
Jul 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. A c = new B();
  13. c.ver();
  14. }
  15. }
  16. class A
  17. {
  18. public virtual void ver()
  19. {
  20. Console.WriteLine("ver 1");
  21. }
  22. }
  23. class B:A
  24. {
  25. public override void ver()
  26. {
  27. Console.WriteLine("ver 2");
  28. }
  29. }
  30. }
Add Comment
Please, Sign In to add comment