多项选择题
You work as an application developer at Certkiller .com. Certkiller .com has instructed you to create a class named MetricFormula. This class will be used to compare MetricUnit and EnglishUnit objects.The MetricFormula is currently defined as follows (Line numbers are used for reference purposes only): 1. public class MetricFormula2. { 3. 4. } You need to ensure that the MetricFormula class can be used to compare the required objects. What should you do? ()
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. -
单项选择题
YouworkasanapplicationdeveloperatCertkiller.com.Certkiller.comhasbeencontractedtodevelopanapplicationforthelocalbank.Youhavebeengiventheresponsibilityofcreatingthisapplicationandneedtostoreeachtransactionrecord,whichisidentifiedusingacomplextransactionidentifier,inmemory.Thebankinformsyouthatthetotalamountoftransactionrecordscouldreach200perday.Toachievethis,youdecidetoutilizeoneoftheexistingcollectionclassesinthe.NET2.0classlibrary.Youneedtoensurethatyouthecollectionclassyouselectisthemostefficientoneforstoringtransactionrecords.Whatshouldyoudo?()
A. Select the ListDictionary collection class.
B. Select the HashTable collection class.
C. Select the Queue collection class.
D. Select the StringCollection collection class.
