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?

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?


A. public ref class MYDictionary : public Dictionary<String^, String^>{};
B. public ref class MYDictionary : public Hashtable{};
C. public ref class MYDictionary : public IDictionary{};
D. public ref class MYDictionary {};Distionary<String^, String^>t = gcnew Dictionary<String^,
    String^>();MyDictionary dictionary = (MyDictionary)t;


Answer: A

No comments:

Post a Comment