nerdexam
Microsoft

98-372 · Question #98

In which of the following types of objects is a Hashtable collection used to store its entries?

The correct answer is D. DictionaryEntry. The Hashtable collection is used to store entries in DictionaryEntry objects. The DictionaryEntry structure is used to define a dictionary key/value pair that can be set or retrieved. The Entry method of the IDictionaryEnumerator structure returns an instance of this type. The…

Understanding Data Types and Collections

Question

In which of the following types of objects is a Hashtable collection used to store its entries?

Options

  • AStack
  • BDictionaryBase
  • CQueue
  • DDictionaryEntry

How the community answered

(23 responses)
  • A
    4% (1)
  • B
    13% (3)
  • C
    4% (1)
  • D
    78% (18)

Explanation

The Hashtable collection is used to store entries in DictionaryEntry objects. The DictionaryEntry structure is used to define a dictionary key/value pair that can be set or retrieved. The Entry method of the IDictionaryEnumerator structure returns an instance of this type. The foreach statement of the C# language needs the type of each element in the collection. Since each element of IDictionary is a key/value pair, the element type is not the type of the key or value. Instead, the element type is DictionaryEntry.

Topics

#Hashtable#DictionaryEntry#DictionaryBase#key-value collections

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice