2 ms·
Their code explicitly depended on the wording of exception messages because they were using a dynamic language. Java is a typed language, where we can match on
by eneveu 8y ago
Their code explicitly depended on the wording of exception messages because they were using a dynamic language. Java is a typed language, where we can match on exception types:
if (ex instanceof NullPointerException)
catch (NullPointerException ex) {
It is therefore rare for Java programmers to match on exception messages (it would be a mistake).