Table of contents
Open Table of contents
Article body
-
With try…catch, simply avoiding another throw is not enough. Remember to record the exception in the logs using a logger.
-
When iterating over a map, entrySet is more efficient than keySet and gives access to both the key and the value. Look up examples if you need the exact usage.
-
When searching a string with indexof, prefer single quotes—’ ‘—where possible; this is more efficient than double quotes.