// exceptions/MainException.java // (c)2021 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://OnJava8.com for more book information. import java.util.*; import java.nio.file.*; public class MainException { // Pass exceptions to the console: public static void main(String[] args) throws Exception { // Open the file: List lines = Files.readAllLines( Paths.get("MainException.java")); // Use the file ... } }