//Operator overloading for + public static Hernandez_CentStudent operator +(Hernandez_CentStudent a, Hernandez_CentStudent b) { Hernandez_CentStudent Centstudent = new Hernandez_CentStudent(); Centstudent.stdName = a.stdName + b.StdName; return(Centstudent); }
static void Main(string[] args) { Hernandez_CentStudent A = new Hernandez_CentStudent(300964840); Console.WriteLine("The students ID is: " + A.stdID); Hernandez_CentStudent B = new Hernandez_CentStudent(300964840, "Tom"); Console.WriteLine("The students Name is " + B.stdName); Hernandez_CentStudent c = new Hernandez_CentStudent(1500.00); Console.WriteLine("The students Fee IS: " + c.StdFee); Console.WriteLine("please enter a new student ID"); Console.ReadKey(); }