Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1.     interface IAnimal
  2.     {
  3.         string Name { get; set; }
  4.         int CalculateSomeValue();
  5.     }
  6.  
  7.     class Dog : IAnimal
  8.     {
  9.         public int weight;
  10.         public string Name { get; set; }
  11.  
  12.         public  int CalculateSomeValue()
  13.         {
  14.             return weight;
  15.         }
  16.     }
  17.  
  18.     class Cat : IAnimal
  19.     {
  20.         public int bloodPressure;
  21.         public string Name { get; set; }
  22.         public int CalculateSomeValue()
  23.         {
  24.             return bloodPressure;
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement