public static Teacherhelper operator -(Teacherhelper c) { Teacherhelper temp = new Teacherhelper(); c.boy = -c.boy; return(c); }
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); }
public Teacherhelper(Teacherhelper c) { Teacherhelper temp = new Teacherhelper(); boy = c.boy; }