Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.IO;
- using System;
- class Program
- {
- public class Base
- {
- public virtual string WhoAmI()
- {
- return "Base";
- }
- }
- public class NotVeryDerived
- {
- public NotVeryDerived()
- {
- _base = new Base();
- }
- Base _base;
- public string WhoAmI(int a)
- {
- var baseResult = _base.WhoAmI();
- return string.Format("{0} {1} {2}", baseResult, "Derived", a);
- }
- }
- static void Main()
- {
- var a = new NotVeryDerived();
- Console.Write(a.WhoAmI(1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement