Ejemplo n.º 1
0
        public static Teacherhelper operator -(Teacherhelper c)
        {
            Teacherhelper temp = new Teacherhelper();

            c.boy = -c.boy;
            return(c);
        }
Ejemplo n.º 2
0
        public string returnUnaryOperator()
        {
            Teacherhelper e1 = new Teacherhelper(10);

            e1 = -e1;
            string test = e1.showBoyGirl();

            Teacherhelper e2    = new Teacherhelper(10);
            string        test2 = e2.showBoyGirl();

            return("Unary Operator minus overload : " + test + " normal :" + test2);
        }
Ejemplo n.º 3
0
        public Teacherhelper(Teacherhelper c)
        {
            Teacherhelper temp = new Teacherhelper();

            boy = c.boy;
        }