Question: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 IDictionary{}; 

B public ref class MyDictionary : public Dictionary<String=, String=>{}; 

C public ref class MyDictionary : public Hashtable{}; 

D public ref class MyDictionary{};
Dictionary<String=, String=> t = gcnew Dictionary<String=, String=>(); MyDictionary dictionary = (MyDictionary)t; 

+ Answer
+ Report
Total Preview: 1141

Copyright © 2024. Powered by Intellect Software Ltd