Advertisement
guidecastro

Class Error

Sep 19th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. class Bicho
  2.     {
  3.         public void Comida()
  4.         {
  5.             Console.WriteLine("Come ração.");
  6.         }
  7.  
  8.     }
  9.  
  10.     class Animal
  11.     {
  12.         public void Comida()
  13.         {
  14.             Console.WriteLine("Não come, está de dieta.");
  15.         }
  16.  
  17.     }
  18.  
  19.     class Alimentacao
  20.     {
  21.         public static void Main(String[] args)
  22.         {
  23.             Bicho x = new Bicho(); //Qual sera chamado? Vai ou nao comer?
  24.             x.Comida();
  25.             Console.ReadKey();
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement