示例#1
0
 static void Main(string[] args)
 {
     EmployeeAdm.Staff staff = new Staff();
     Employee newEmp = new Employee("Hansen", 11, new DateTime(1990, 8, 27));
     staff.AddEmployee(newEmp);
     newEmp = new Employee("Jensen", 12, new DateTime(1988, 1, 20));
     staff.AddEmployee(newEmp);
     Console.Out.WriteLine(staff);
     Console.Read();
 }
示例#2
0
 static void Main(string[] args)
 {
     EmployeeAdm.Staff staff = new Staff();
     Employee newEmp = new Employee("Hansen", 11, new DateTime(1990, 8, 27));
     staff.AddEmployee(newEmp);
     newEmp = new Employee("Jensen", 12, new DateTime(1988, 1, 20));
     staff += newEmp; // + operator is overloaded
     staff.AddEmployee(newEmp);
     foreach(Employee emp in staff)
         Console.Out.WriteLine(emp);
     Console.Read();
 }