Beispiel #1
0
        public static OperOver operator +(OperOver l, OperOver m)
        {
            OperOver temp = new OperOver();

            temp.num1 = l.num1 + m.num1;
            temp.num2 = l.num2 + m.num2;
            return(temp);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("O1 operator============================");
            OperOver o1 = new OperOver();

            o1.SetValues(100, 200);
            o1.GetValues();
            Console.WriteLine("O2 operator====================");
            OperOver o2 = new OperOver();

            o1.SetValues(500, 100);
            o1.GetValues();
            Console.WriteLine("R operator====================");
            OperOver r = new OperOver();

            r = o1 + o2;
            r.GetValues();
        }