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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started