Advertisement
wingman007

C#_OOP_Principles_Manager.cs

May 19th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Exam
  8. {
  9.     class Manager
  10.     {
  11.         private AnimalInterface animal;
  12.  
  13.         public AnimalInterface Anima
  14.         {
  15.             get { return animal; }
  16.             set { animal = value; }
  17.         }
  18.  
  19.         public Manager()
  20.         { }
  21.  
  22.         public Manager(AnimalInterface animal)
  23.         {
  24.             this.animal = animal;
  25.         }
  26.  
  27.         public void IntroduceAnimal()
  28.         {
  29.             if (animal == null)
  30.             {
  31.                 Console.WriteLine("There is no animal");
  32.             }
  33.             else {
  34.                 Console.WriteLine(animal.IntroduceYourSelf());
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement