Question: public class MyClass { private Map map; public MyClass() { map = new HashMap (); map.put(foo, 1); map.put(bar, 3); } public int getValue(String input, int
public class MyClass { private Map
My answer is as follows, I would just like to see if it is correct:
1) runs getValue 1 time and returns 1 2) runs getValue 1 time and returns 3 3) runs getValue 3 times and throws an exception after the third run 4) runs getValue 2 times and throws an exception after the second run
In total getValue runs 7 times
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
