PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You need to ensure that the dictionary is type safe. Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
class MyDictionary : Dictionary<string, string>

B.
class MyDictionary : HashTable

C.
class MyDictionary : IDictionary

D.
class MyDictionary { … } Dictionary<string, string>
t = new Dictionary<string, string>();
MyDictionary dictionary = (MyDictionary)t;


Leave a Reply