Beispiel #1
0
        static void Main(string[] args)
        {
            Pig myPig = new Pig(); // Create a Pig object

            myPig.animalSound();   // Call the abstract method
            myPig.sleep();         // Call the regular method
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Pig myPig = new Pig();
            Dog myDog = new Dog();

            myDog.sleep();
            myPig.animalSound();

            myDog.animalSound();
        }