public static void Main()
    {
        Turtle turtle = new Turtle();

        Console.WriteLine(turtle);
        Console.WriteLine("The {0} can go {1} km/h ", turtle.GetName(), turtle.Speed);

        Console.WriteLine();

        Cheetah cheetah = new Cheetah();

        Console.WriteLine(cheetah);
        Console.WriteLine("The {0} can go {1} km/h ", cheetah.GetName(), cheetah.Speed);

        Console.WriteLine();

        Tomcat tomcat = new Tomcat();

        Console.WriteLine(tomcat);
        Console.WriteLine("The {0} can go {1} km/h ", tomcat.GetName(), tomcat.Speed);
        tomcat.SayMyaau();

        Console.WriteLine();

        Kitten kitten = new Kitten();

        Console.WriteLine(kitten);
        Console.WriteLine("The {0} can go {1} km/h ", kitten.GetName(), kitten.Speed);
        kitten.Breed = "siamska";//Ot dopalnitelnoto Property ot Cat
        Console.WriteLine("The breed of the {0} is {1}", kitten.GetName(), kitten.Breed);
        kitten.SayMyaau();

        // This will not compile (Cat is abstract -> cannot be instantiated)
        //Cat cat = new Cat();
    }
    public static void Main()
    {
        Turtle turtle = new Turtle();
        Console.WriteLine(turtle);
        Console.WriteLine("The {0} can go {1} km/h ", turtle.GetName(), turtle.Speed);

        Console.WriteLine();

        Cheetah cheetah = new Cheetah();
        Console.WriteLine(cheetah);
        Console.WriteLine("The {0} can go {1} km/h ", cheetah.GetName(), cheetah.Speed);

        Console.WriteLine();

        Tomcat tomcat = new Tomcat();
        Console.WriteLine(tomcat);
        Console.WriteLine("The {0} can go {1} km/h ", tomcat.GetName(), tomcat.Speed);
        tomcat.SayMyaau();

        Console.WriteLine();

        Kitten kitten = new Kitten();
        Console.WriteLine(kitten);
        Console.WriteLine("The {0} can go {1} km/h ", kitten.GetName(), kitten.Speed);
        kitten.SayMyaau();

        // This will not compile (Cat is abstract -> cannot be instantiated)
        //Cat cat = new Cat();
    }
Esempio n. 3
0
    static void Main()
    {
        Turtle turtle = new Turtle();

        Console.WriteLine(turtle);
        Console.WriteLine("The {0} can go {1} km/h ", turtle.GetName(), turtle.Speed);

        Console.WriteLine();

        Cheetah cheetah = new Cheetah();

        Console.WriteLine(cheetah);
        Console.WriteLine("The {0} can go {1} km/h ", cheetah.GetName(), cheetah.Speed);

        Console.WriteLine();

        Tomcat tomcat = new Tomcat();

        Console.WriteLine(tomcat);
        Console.WriteLine("The {0} can go {1} km/h ", tomcat.GetName(), tomcat.Speed);
        tomcat.SayMyaau();

        Console.WriteLine();

        Kitten kitten = new Kitten();

        Console.WriteLine(kitten);
        Console.WriteLine("The {0} can go {1} km/h ", kitten.GetName(), kitten.Speed);
        kitten.SayMyaau();

        // This wil not compile (Cat is abstract -> cannot be instantiated)
        //Cat cat = new Cat();
    }
    static void Main()
    {
        Turtle turtle = new Turtle();
        Console.WriteLine("The {0} can go {1} km/h ",
            turtle.GetName(), turtle.Speed);
        Cheetah cheetah = new Cheetah();
        Console.WriteLine("The {0} can go {1} km/h ",
            cheetah.GetName(), cheetah.Speed);

        System.Collections.Generic.List<int> l;
        System.DateTime dt;
    }
    static void Main()
    {
        Turtle turtle = new Turtle();

        Console.WriteLine("The {0} can go {1} km/h ",
                          turtle.GetName(), turtle.Speed);
        Cheetah cheetah = new Cheetah();

        Console.WriteLine("The {0} can go {1} km/h ",
                          cheetah.GetName(), cheetah.Speed);

        System.Collections.Generic.List <int> l;
        System.DateTime dt;
    }
Esempio n. 6
0
    static void Main()
    {
        Turtle turtle = new Turtle();

        Console.WriteLine(turtle);                         //I am turtle
        Console.WriteLine("The {0} can go {1} km/h ",
                          turtle.GetName(), turtle.Speed); //The turtle can go 1 km/h

        Console.WriteLine();

        Cheetah cheetah = new Cheetah();

        Console.WriteLine(cheetah);                          //I am cheetah
        Console.WriteLine("The {0} can go {1} km/h ",
                          cheetah.GetName(), cheetah.Speed); //The cheetah can go 100 km/h

        Console.WriteLine();

        Tomcat tomcat = new Tomcat();

        Console.WriteLine(tomcat);                         //I am tomcat
        Console.WriteLine("The {0} can go {1} km/h ",
                          tomcat.GetName(), tomcat.Speed); //The tomcat can go 20 km/h
        tomcat.SayMyaau();                                 //Tomcat muaaaaaaaau

        Console.WriteLine();

        Kitten kitten = new Kitten();

        Console.WriteLine(kitten);                         //I am kitten
        Console.WriteLine("The {0} can go {1} km/h ",
                          kitten.GetName(), kitten.Speed); //The kitten can go 5 km/h
        kitten.SayMyaau();                                 //Kitten miau, miaau

        // This wil not compile (Cat is abstract -> cannot be instantiated)
        //Cat cat = new Cat();
    }