What should you do?

Domain.com has been contracted to develop an application for the local bank.
You have been given the responsibility of creating this application and need to store each transaction record,
which is identified using a complex transaction identifier, in memory. The bank informs you that the total amount of transaction records could reach 200 per day.
To achieve this, you decide to utilize one of the existing collection classes in the .NET 2.0 class library.
You need to ensure that you the collection class you select is the most efficient one for storing transaction records.
What should you do?

Domain.com has been contracted to develop an application for the local bank.
You have been given the responsibility of creating this application and need to store each transaction record,
which is identified using a complex transaction identifier, in memory. The bank informs you that the total amount of transaction records could reach 200 per day.
To achieve this, you decide to utilize one of the existing collection classes in the .NET 2.0 class library.
You need to ensure that you the collection class you select is the most efficient one for storing transaction records.
What should you do?

A.
Select the ListDictionary collection class.

B.
Select the HashTable collection class.

C.
Select the Queue collection class.

D.
Select the StringCollection collection class.

Explanation:
You should select the HashTable class to store transaction records because each element is identified using a unique identifier and the size of the collection is large.
Elements in the HashTable collection are stored with a key/value pair where each key is created using a hash code.
The default capacity of a HashTable class is zero, and you can use the Add method to add a new element to the collection.
The Count property provides the total number of elements in the HashTable collection. An element of the HashTable class can be accessed using the DictionaryEntry class. You can use the Key and Value properties of the DictionaryEntry class to access the key associated with the element and the value of
the element, respectively.
Incorrect Answers:
A: You should not select this collection class because this class is used if the total number of elements to be stored in a collection
is less than 10 elements in length.
C: You should not select this collection class because you need to access transaction records using a transaction identifier,
not in sequential order.
D: You should not select this collection class because this class is used to manage a collection of string values.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


mr_tienvu

mr_tienvu

I agree with the answer. B