Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1.     class Undecorated {
  2.         public void Method1() {
  3.             Console.WriteLine("Undecorated");
  4.         }
  5.     }
  6.  
  7.     class Decorated : Undecorated {
  8.         Undecorated u { get; set; }
  9.  
  10.         public void Method1() {
  11.             u.Method1();
  12.             Console.WriteLine("Decorated");
  13.         }
  14.     }
  15.  
  16.     class Program {
  17.  
  18.         static void Main(string[] args) {
  19.             Undecorated u = new Decorated();
  20.             u.Method1();
  21.  
  22.             Console.ReadKey();
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement