예제 #1
0
        static void Main(string[] args)
        {
            Animal spot = new Animal(15, 10, "Spot", "Woof");

            Console.WriteLine("{0} says {1}", spot name, spot sound);

            Console.WriteLine("Number of Animals " + Animal.getNumOfAnimals());

            Console.WriteLine(spot.toString());
        }
예제 #2
0
        static void Main(string[] args)
        {
            Animal spot = new Animal(15, 10, "Spot", "Woof");

            Console.WriteLine("{0} says {1}", spot name, spot sound);

            Console.WriteLine("Number of Animals " + Animal.getNumOfAnimals());


            Console.WriteLine(spot.toString());

            Console.WriteLine(spot.getSum(num2: 1.4, 2.7));

            Animal grover = new Animal
            {
                name   = "Grover",
                height = 16,
                weight = 18,
                sound  = "Grrr"
            };