wingman007

OOP_2015_Animals_Animal

Mar 20th, 2015
271
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;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Animals1a
  8. {
  9.     abstract class Animal : IMakeNoise
  10.     {
  11.         private string name;
  12.  
  13.         public string Name
  14.         {
  15.             get { return name; }
  16.             set { name = value; }
  17.         }
  18.  
  19.         public Animal(string name)
  20.         {
  21.             this.name = name;
  22.         }
  23.  
  24.         public virtual void MakeNoise()
  25.         {
  26.             Console.WriteLine("Grrrrr. My name is {0}", name);
  27.         }
  28.     }
  29. }
Add Comment
Please, Sign In to add comment