I was recently experimenting with a try-catch block while dealing with the get method on a HashMap object instance.
The compiler does not require a try-catch (indeed that may be the answer) but in the
Java API,
the Map interface (which HashMap implements) says it the get method throws two
different exceptions.
Why doesn't the compiler require a try-catch block around the get method?
When is it "appropriate" to use try catch exception processing other than when it is required by the compiler?