欢迎来到建筑考试题库网 建筑考试题库官网
全部科目 > 微软认证考试 > MCPD > MCPD(70-536)

单项选择题

You work as an application developer at Certkiller .com. Certkiller .com wants you to develop an application that stores and retrieves client information by means of a unique account number.You create a custom collection class, which implements the IDictionary interface,named ClientDictionary. The following code have been included into the new application.

You use the same method to add other Client objects to the collection. You need to ensure that you are able to retrieve client information associated with the account number 10111.What should you do?()

    A. Use the following code: Client foundClient;foundClient = (Client) cData.Find ("10111");
    B. Use the following code: Client foundClient;if (cData.Contains ("10111")) foundClient = cData ["10111"];
    C. Use the following code: Client foundClient;if (cData.Contains ("10111"))foundClient =(Client) cData ["10111"];
    D. Use the following code: Client foundClient;foreach (string key in cData.Keys {if (key == "10111")foundClient = (Client) cData.Values ["10111"]; }

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题