|
C# 2008 Programmer's Referenceint Salary { get; set; } public override string ToString() { return FirstName + ", " + LastName + " $" + Salary; } public int CompareTo(Employee emp) { return this.FirstName.CompareTo(emp.FirstName); } } You can now sort by LastName using the LastNameSorter property: employees.Sort(Employee.LastNameSorter); //---sort using LastName--- Dictionary Most of you are familiar with the term dictionary — a reference book containing an alphabetical list of words with information about them ...» |
Код для вставки книги в блог HTML
phpBB
текст
|
|