Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Apple apple  = new Apple("Красное яблоко", 50, 100);
            Apple apple2 = new Apple("зеленое яблоко", 40, 300);

            var SummApple    = Apple.Add(apple, apple2);
            var SUmmApple2   = apple + apple2;
            var SummAppleInt = apple + 600;

            Console.WriteLine(apple);
            Console.WriteLine(apple2);
            Console.WriteLine(SummApple);
            Console.WriteLine(SUmmApple2);
            Console.WriteLine(SummAppleInt);
            Console.ReadLine();
        }
Ejemplo n.º 2
0
 public static Apple operator +(Apple apple1, int volume)
 {
     return(Apple.Add(apple1, volume));
 }
Ejemplo n.º 3
0
 public static Apple operator +(Apple apple1, Apple apple2)
 {
     return(Apple.Add(apple1, apple2));
 }