Advertisement
RazorBlade57

Materials

Apr 8th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. http://www.cs.utexas.edu/~mitra/csSummer2012/cs312/lectures/fileIO.html
  2.  
  3. ///////////////////////////////////////////////////////////////////////
  4.  
  5. The try block will execute a sensitive code which can throw exceptions
  6. The catch block will be used whenever an exception (of the type caught) is thrown in the try block
  7. The finally block is called in every case after the try/catch blocks. Even if the exception isn't caught or if your previous blocks break the execution flow.
  8. The throw keyword will allow you to throw an exception (which will break the execution flow and can be caught in a catch block).
  9. The throws keyword in the method prototype is used to specify that your method might throw exceptions of the specified type. It's useful when you have checked exception (exception that you have to handle) that you don't want to catch in your current method.
  10.  
  11. https://stackoverflow.com/questions/3794910/difference-between-try-catch-and-throw-in-java
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement