Mega Code Archive

 
Categories / Java / Language Basics
 

Exception in main method

// : c09:MainException.java // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002 // www.BruceEckel.com. See copyright notice in CopyRight.txt. import java.io.FileInputStream; public class MainException {   // Pass all exceptions to the console:   public static void main(String[] args) throws Exception {     // Open the file:     FileInputStream file = new FileInputStream("MainException.java");     // Use the file ...     // Close the file:     file.close();   } } ///:~