Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Problems
- {
- using System;
- internal class Program
- {
- class A
- {
- public virtual void F(int a)
- {
- Console.WriteLine("(1) A.F(int)");
- }
- }
- class B : A
- {
- public void F(object a)
- //public void F(object a)
- {
- Console.WriteLine("(2) B.F(object)");
- }
- public override void F(int a)
- //public override void F(int a)
- {
- Console.WriteLine("(3) B.F(int)");
- }
- }
- class C : B
- {
- public override void F(int a)
- {
- Console.WriteLine("(4) C.F(int)");
- }
- public void F<T>(params T[] a)
- {
- Console.WriteLine("(5) C.F(params T[]");
- }
- }
- public static void Main(string[] args)
- {
- //new B().F(33);
- new B().F("33");
- new B().F("argument");
- new C().F("argument");
- new C().F(33);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment