Microsoft
98-372 · Question #172
You create an ArrayList object. You need to ensure that only objects of the System.DateTime type can be added to the collection. What should you do?
The correct answer is C. Use a List(Of T) collection. See the full explanation below for the reasoning.
Question
You create an ArrayList object. You need to ensure that only objects of the System.DateTime type can be added to the collection. What should you do?
Options
- ARestrict the ArrayList variable to a capacity of 16 items.
- BUse a Hashtable collection.
- CUse a List(Of T) collection.
- DUse the ToString() method on objects that you add to the ArrayList.
How the community answered
(64 responses)- A3% (2)
- B6% (4)
- C78% (50)
- D13% (8)
Community Discussion
No community discussion yet for this question.