Checked vs unchecked exceptions

Figure 430. Checked and unchecked exceptions Slide presentation Create comment in forum
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 431. Checked and unchecked exceptions Slide presentation Create comment in forum