单项选择题
You work as an application developer at Certkiller .com. You are developing an application that makes use of a Queue class object named MyQueue. This Queue class object will be used to store messages sent by the user during application run time. The application that you are developing provides an interface for administrators and an interface for users to create message reports.You want to ensure that all user messages stored in the MyQueue object are removed when an administrator selects the reset option.What should you do?()
A. Use the Enqueue method of the MyQueue object.
B. Use the Clear method of the MyQueue object.
C. Use the Dequeue method of the MyQueue object.
D. Use the TrimToSize method of the MyQueue object.
相关考题
-
多项选择题
YouworkasanapplicationdeveloperatCertkiller.com.Certkiller.comhasinstructedyoutocreateaclassnamedMetricFormula.ThisclasswillbeusedtocompareMetricUnitandEnglishUnitobjects.TheMetricFormulaiscurrentlydefinedasfollows(Linenumbersareusedforreferencepurposesonly):1.publicclassMetricFormula2.{3.4.}YouneedtoensurethattheMetricFormulaclasscanbeusedtocomparetherequiredobjects.Whatshouldyoudo?()
A. Add the following code on line 1: : IComparable {
B. Add the following code on line 1: : IComparer {
C. Add the following code on line 3: public int Compare (object x, object y) {// implementation code }
D. Add the following code on line 3: public int CompareTo (object obj) {// implementation code } -
单项选择题
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"]; } -
单项选择题
YouworkasanapplicationdeveloperatCertkiller.com.Certkiller.comhasbeenhiredbyasmalllocalprivateschooltodevelopaclasslibrarythatwillbeusedinanapplicationnamedManageAttendanceforthepurposeofmanagingstudentrecords.Youareresponsiblefordevelopingthisclasslibrary.Certkiller.comhasinstructedyoutocreateacollectionintheapplicationtostorelearners’results.Theschoolhasinformedyouthattheycurrentlyonlyhavesevenlearners,butthatthisvaluewilltripleinthefollowingyear.Duetothelimitedresources,youneedtoensurethatthecollectionyoucreateconsumesaminimumamountofresources.Whatshouldyouusetocreatethecollection?()
A. The HybridDictionary collection class.
B. The HashTable collection class.
C. The ListDictionary collection class.
D. The StringCollection collection class.
