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; } }
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(); }