Hi, Here is the code from Generics K&B Page 638 Question 5
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); //Type mismatch: cannot convert from Object to Integer
if (total == null) total = 0;
return total;
How come Option "E" is correct..I am getting Type mismatch: cannot convert from Object to Integer error..Please advice