Exemple #1
0
        public object Clone()
        {
            Student temp = new Student(this.FirstName, this.MiddleName,
                                       this.LastName, this.SSN, this.Address, this.Phone, this.Email.Address);

            temp.FillUniversityInfo(this.University, this.Course, this.Faculty, this.Speciality);

            return(temp);
        }
        static void Main(string[] args)
        {
            Student student = new Student("Jhon", "M", "Jakson", 10002922, "Telerik", "+359 885", "*****@*****.**");

            student.FillUniversityInfo(Student._University.SofiaUniversity, 4, Student._Faculty.Mathematics, Student._Speciality.IT);
            Console.WriteLine(student.GetHashCode());
            Student student2 = new Student("Mark", "S", "Morison", 10034222, "Telerik", "+359 883", "*****@*****.**");

            student2.FillUniversityInfo(Student._University.TechnicalUniversity, 4, Student._Faculty.Mathematics, Student._Speciality.IT);
            Console.WriteLine(student2.GetHashCode() + Environment.NewLine);

            Console.WriteLine(student);
            Console.WriteLine(student2);
            Console.WriteLine(student == student2);
            Console.WriteLine(student.Equals(student));
            Console.WriteLine(student.Equals(student2));
            Console.WriteLine(student != student2);
        }