Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Klasa zwierząt
- // Kury
- // Krowy
- public abstract class Animal
- {
- public virtual void Eat()
- {
- Console.WriteLine("Zwierze je");
- }
- public abstract void TakeSound();
- }
- public class Cow : Animal
- {
- public override void TakeSound()
- {
- System.Console.WriteLine("Krowa robi muuu");
- }
- public override void Eat()
- {
- System.Console.WriteLine("Krowa je trawę");
- }
- }
- public class Hen: Animal
- {
- public override void TakeSound()
- {
- System.Console.WriteLine("kura robi ko ko");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment