Содержание
- 2. Agenda Interface declaration Interface implementation Built-in .Net interfaces Task 5.1 Collections in C# ArrayList & List
- 3. Interface declaration An interface contains definitions for a group of related functionalities that a class or
- 4. Interface declaration
- 5. Interface Implementation
- 6. Interface Implementation Any class or struct that implements the interface must implement all its members. By
- 7. Interface Implementation
- 8. FCL .Net Interfaces IEnumerable: The IEnumerable interface allows foreach-loops on collections. It is often used in
- 9. .Net Library Interfaces class Doctor:IComparable { int CompareTo(Doctor other) { return salary-other.salary; } ... } public
- 10. Task 5.1 Develop interface IFlyable with method Fly(). Create two classes Bird (with fields: name and
- 11. C# Collections. Generic collections
- 12. C# Collections .NET framework provides specialized classes for data storage and retrieval. There are two distinct
- 13. C# Collections System.Collections.Generic System.Collections List ArrayList Dictionary HashTable SortedList , SortedDictionary SortedList Stack Stack Queue Queue
- 14. ArrayList ArrayList is a special array that provides us with some functionality over and above that
- 15. ArrayList public class ArrayList : IList, ICloneable { int Add (object value) // at the end
- 16. List List is a strongly typed list of objects that can be accessed by index. It
- 17. List&ArrayList example
- 18. Using IEnumerable interface static void Display(IEnumerable values) { foreach (int value in values) { Console.WriteLine(value); }
- 19. Dictionary A Dictionary, also called an associative array, is a collection of unique keys and a
- 20. Dictionary Dictionary where we map domain names to their country names: Retrieve values by their keys
- 21. Dictionary example
- 22. Queue A Queue is a First-In-First-Out (FIFO) data structure. The first element added to the queue
- 23. Stack A stack is a Last-In-First-Out (LIFO) data structure. The last element added to the queue
- 24. Queue & Stack example
- 25. Task 5.2 Develop interface IFlyable with method Fly(). Create two classes Bird (with fields: name and
- 27. Скачать презентацию