Beispiel #1
0
        static void Main(string[] args)
        {
            Dog dog = new Dog();

            dog.Kind = "Danua";
            dog.Name = "çomar";

            Cat cat = new Cat();

            cat.Kind = "Munchkin";
            cat.Name = "pati";

            Bird bird = new Bird();

            bird.Kind = "Parrot";
            bird.Name = "bıcırık";

            Pig pig = new Pig();

            pig.Kind = "Peppa";
            pig.Name = "Peppa";


            Console.WriteLine($@"
Dog Sound   :{dog.AnimalSound()}
Cat Sound   :{cat.AnimalSound()}
Bird Sound  :{bird.AnimalSound()}
Pig Sound   :{pig.AnimalSound()}");
        }
        static void Main(string[] args)
        {
            Pig myPig = new Pig();  // Create a Pig object

            myPig.AnimalSound();
            myPig.Sleep();


            Dog myDog = new Dog();  // Create a Dog object

            myDog.AnimalSound();
            myDog.Sleep();
        }