Example #1
0
        static void Main()
        {
            Student1 student1 = new Student1("MIT", "M.Tech", "jay");

            student1.GetDept();
            student1.DisplayStuInfo();
            GC.Collect();
            Console.Read();
        }
 private static void PersonTester(IPerson person)
 {
     if (person is Teacher2)
     {
         Teacher2 t = person as Teacher2;
     }
     else if (person is Student1)
     {
         Student1 t = person as Student1;
     }
 }
Example #3
0
        static void Main()
        {
            Student1 student = new Student1("JNTU", "MBA", "Vinni");

            student.DisplayDept();
            student.DisplayStudent();
            Console.WriteLine(student.CollegeName);
            Console.WriteLine("dptname is {0} for student {1}", student.DepartmentName, student.StudentName);
            Department dptobj = new Department();

            Console.Read();
            GC.Collect();
        }