Instead of a foreach statement, a for statement that iterates in descending order is used | Retrieving a value by using its key is fast because the Dictionary class is implemented as a hash table |
---|---|
Name ; } } The following example instead uses the method quickly find an item by key | Getting tested for hepatitis C is important, because treatments can cure most people with hepatitis C in 8 to 12 weeks |
The index of the elements starts at 0 and ends at the element count minus 1.
5A generic collection is useful when every item in the collection has the same data type | Provides methods to search, sort, and modify lists |
---|---|
In the following example, the Galaxy class that is used by the is defined in the code | Whenever possible, you should use the generic collections in the namespace or the namespace instead of the legacy types in the System |
Collections Classes The classes in the namespace do not store elements as specifically typed objects, but as objects of type Object.
3But the text within a CDATA section is strictly limited to the characters available in the encoding | Collections namespace: Class Description Represents an array of objects whose size is dynamically increased as required |
---|---|
The following example is the same as the previous example, except a collection initializer is used to add elements to the collection | When symptoms appear, they often are a sign of advanced liver disease |
The best way to prevent hepatitis C is by avoiding behaviors that can spread the disease, especially injecting drugs.
2