Skip to main content
PProfileMatch
← Path

Advanced Java · Java Exceptions, try-with-resources and NIO File Handling

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Customs desk at the border

Trick to keep in mind+3 XP

Checked: the caller can recover, so the compiler nags. Unchecked: fix the code, so no nagging.

Checked exceptions are Exception subclasses outside the RuntimeException family, and the compiler forces every caller to catch or declare them. RuntimeException and its subclasses are unchecked and usually mean a bug, such as a bad argument, a null or an illegal state. Parsing a number badly also lands in the unchecked family. Errors describe a broken JVM and are rarely worth catching.

Read it once, then a question tests whether the trick stuck.