Hi.
About the question 8 of the Self
test, chapter 2 say:
You need to update a value of a hash table (that is, HashMap) where the primary key must equal a specified
string. Which statements would you need to use in the implementation of this algorithm?
A. Iteration statement
B. Expression statement
C. Conditional statement
D. Transfer of control statement
Answer: A, B, and C. Iteration, expression, and conditional statements would be used to implement the algorithm.
The following code segment demonstrates the use of these statements by programmatically replacing the ring on the little finger of a person’s left hand. The statements are prefaced by comments that identify their types.
In my opinion this question is a little confuse, because if I know the key I can update a HashMap without the support of Iteration statement and without the Conditional statement as below:
If I must use the Iteration statement and the Conditional statement I can use the Transfer of control statement also.
What do you think?
Thanks