Guest User

Untitled

a guest
Jul 6th, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. namespace Problems
  2. {
  3. using System;
  4. internal class Program
  5. {
  6. class A
  7. {
  8. public virtual void F(int a)
  9. {
  10. Console.WriteLine("(1) A.F(int)");
  11. }
  12. }
  13. class B : A
  14. {
  15. public void F(object a)
  16. //public void F(object a)
  17. {
  18. Console.WriteLine("(2) B.F(object)");
  19. }
  20. public override void F(int a)
  21. //public override void F(int a)
  22. {
  23. Console.WriteLine("(3) B.F(int)");
  24. }
  25. }
  26. class C : B
  27. {
  28. public override void F(int a)
  29. {
  30. Console.WriteLine("(4) C.F(int)");
  31. }
  32. public void F<T>(params T[] a)
  33. {
  34. Console.WriteLine("(5) C.F(params T[]");
  35. }
  36. }
  37. public static void Main(string[] args)
  38. {
  39. //new B().F(33);
  40. new B().F("33");
  41. new B().F("argument");
  42. new C().F("argument");
  43. new C().F(33);
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment