Phase 1 Language Basics + Advanced _1-3-Java language senior _05- first way abnormal and multi-threaded Section 1 _ _ abnormal _6_throws keywords exception handling










Here the exception thrown when writing code is compiled on the error. Why is that?



Calling this method will readFile abnormal, need to throw when thrown compiled


Alt + Enter shortcut first option. Continue to declare the exception.





Change the path will throw an exception.




.Txt file extension is not the end. FileNotFoundException this is an exception during compilation.


In vivo method must declare this IOException exception




FileNotFound is a subclass of IOException. So long as a statement on it.



It omitted here. FileNotFoundException



subclass of Exception are all exceptions. So a separate statement Exception is also possible.



Guess you like

Origin www.cnblogs.com/wangjunwei/p/11248721.html