Advertisement
Guest User

Untitled

a guest
Oct 16th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System.IO;
  2. using System;
  3.  
  4. class Program
  5. {
  6.     public class Base
  7. {
  8.     public virtual string WhoAmI()
  9.     {
  10.         return "Base";
  11.     }
  12. }
  13.  
  14. public class NotVeryDerived
  15. {
  16.     public NotVeryDerived()
  17.     {
  18.         _base = new Base();    
  19.     }
  20.     Base _base;
  21.    
  22.     public string WhoAmI(int a)
  23.     {
  24.         var baseResult  = _base.WhoAmI();
  25.         return string.Format("{0} {1} {2}", baseResult, "Derived", a);
  26.     }
  27. }
  28.  
  29.     static void Main()
  30.     {
  31.         var a = new NotVeryDerived();
  32.        Console.Write(a.WhoAmI(1));
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement