Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Car car1 = new Car();
            Car car2 = new Car();
            Car car3 = car1 + car2;
            Console.WriteLine(car3.Price);
            Console.WriteLine(car1 < car2);
            Car car5 = car1 * car2;
            Console.WriteLine(car5.Price);
            Human man = new Human();
            Transformer transformer = Transformer.GetTransformer;
            transformer.a = 5;
            Transformer transformer2 = Transformer.GetTransformer;
            transformer2.a = 7;
            transformer.RaiseSon();
            man.WriteToFile();
            Console.WriteLine(transformer.a);
            Console.WriteLine(transformer2.a);
            Car f = new Car();
            message DelegateToString = (obj) => { return obj.ToString(); };
            Console.WriteLine(DelegateToString(man));

            Car tr1 = new Car();
            Human hm = new Human();
            hm.PlantTree();
            transformer.BuildHouse();
            Console.ReadKey();
        }
Exemplo n.º 2
0
 public static Car operator *(Car obj1, Car obj2)
 {
     Car car = new Car();
     car.Price = obj1.Price * obj2.Price;
     return car;
 }