示例#1
0
        static void Main(string[] args)
        {
            Bear barryTheBear = new Bear();

            barryTheBear.Weight = 2000;

            Lemur melman = new Lemur();

            melman.Weight       = 25;
            melman.HasFingers   = true;
            melman.NumberOfLegs = 2;

            PolarBear cokeaCola = new PolarBear();
            Animal    theJSWiz  = new Animal();

            theJSWiz.NumberOfLegs = 2;
            theJSWiz.Eyes         = true;



            barryTheBear.Walk();
            barryTheBear.Speak();

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Bear barryTheBear = new Bear();

            barryTheBear.Weight = 2000;

            Dog Freddy = new Dog();

            Freddy.Weight  = 250;
            Freddy.Name    = "Fred the odd one";
            Freddy.HasEyes = true;

            Console.WriteLine(Freddy.Weight);

            barryTheBear.Walks();
            barryTheBear.Speak();

            Polarbear cokeACola = new Polarbear();


            Console.ReadLine();
        }