From the course: Java Exception Handling
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Exception: IOException - Java Tutorial
From the course: Java Exception Handling
Exception: IOException
- [Instructor] In this example, we will learn the first part of handling an exception. We will look at the IO exception, which is a checked exception, and we will declare that a method we'll throw it. To do this, I have made some changes to the Fibonacci app. In a Fibonacci controller, I have added a new end point online 33 co create sequence. This generate Fibonacci sequence method online 34, takes in a request forum of in. We've been past that in value to the GIT sequence method to find online 45. This method will generate an array list of integers representing the sequence. If N is three and array with values 0, 1, 1, and two will be returned. Online 36 of our new in play we also store the sequence in a file using the store method. The store method is defined online 67. We have not yet implemented, but it will return a string value representing the name of the file holding the new sequence. Online 36, that string…