Checked vs unchecked exceptions

Figure 511. Checked and unchecked exceptions Slide presentation
public static void main(String[] args) {
  final Path
    sourcePath = Paths.get("/tmp/test.txt"),
    destPath = Paths.get("/tmp/copy.java");

  // Compile time error:
  // Unhandled exception:
      java.io.IOException
  Files.copy(sourcePath, destPath);
...
public static void
  main(String[] args) {

final String s = null;

// No problem
System.out.println(s.length());

Figure 512. Checked and unchecked exceptions Slide presentation