This class is to be updated to make use of appropriate generic types, with no changes in behavior
(for better or worse). Which of these steps could be performed? (Choose three.)
Correct answers are
B. Replace line 13 with
private Map<
String, Integer> accountTotals = new HashMap<String, Integer>();
E. Replace lines 17–20 with
Integer total = accountTotals.get(accountName);
if (total == null) total = 0;
return total;
G. Replace line 24 with
accountTotals.put(accountName, amount);
My doubt is, why should option G be in the list of answers?
Though it does not harm replacing line 24, but it is unnecessary as far as the question is concerned(just making use of generic types)
Can anyone please correct me, if I am wrong?