static void Main(string[] args)
        {
            Animal dog = new Animal();

            dog.Print();

            Animal cat = new Animal("Bobby", 10, 0.8f);

            cat.Print();


            Console.WriteLine("The number of animals is " + Animal.Count);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Animal dog = new Animal();

            dog.Print();
            Console.WriteLine();
            Animal.Count += 1;

            Animal cat = new Animal("Mr. Beans", 10, 0.8f);

            cat.Print();
            Console.WriteLine();
            Console.WriteLine($"Number of Animals: {Animal .Count}");

            Console.ReadLine();
        }