nerdexam
Microsoft

98-372 · Question #49

Which of the following collections can be accessed by a key? Each correct answer represents a complete solution. Choose all that apply.

The correct answer is B. SortedList D. An implementation of IDictionary. Both SortedList as well as an implementation of IDictionary can be accessed by using a key. The IDictionary interface represents a non-generic collection of key/value pairs. It is the base interface for all the non-generic collections of key/value pairs. The IDictionary implement

Understanding Data Types and Collections

Question

Which of the following collections can be accessed by a key? Each correct answer represents a complete solution. Choose all that apply.

Options

  • ABitArray
  • BSortedList
  • CAn implementation of IList
  • DAn implementation of IDictionary

How the community answered

(44 responses)
  • A
    9% (4)
  • B
    73% (32)
  • C
    18% (8)

Explanation

Both SortedList as well as an implementation of IDictionary can be accessed by using a key. The IDictionary interface represents a non-generic collection of key/value pairs. It is the base interface for all the non-generic collections of key/value pairs. The IDictionary implementations fall into three categories, which are as follows: 1.Read-only: An IDictionary object cannot be modified. 2.Fixed size: An IDictionary object cannot be allowed to add or remove elements. 3.Variable size: An IDictionary object can add, remove, or modify elements. The IDictionary interface does not allow any sorting. Answer: A is incorrect. Elements of a BitArray collection are accessed by using an integer index. Answer: C is incorrect. An implementation of IList can be accessed by using an integer index.

Topics

#IDictionary#SortedList#key-value collections#collection interfaces

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice