What is an IOException ?
An IOException is any unexpected issue that the JVM encounters when trying to run a program. Possible problems that he may face:
- attempt to read from a file that does not exist
- attempt to write to a file that has an invalid name (slash or question mark in the header should do this)
- attempt to read the next token in the file when there are no more tokens.
When an IOException is IOException , it means that everything that throws an exception (possibly a try{}-catch that reads data from a file) can IOException , for example, if the file is not found, corrupted, etc., or when the file otherwise cannot be read, or any other of the list of problems that may arise with the IO package and its extensions.
What to do when you encounter an IOException ?
When you encounter an IOException , you can register it or print an error message. If you are reading a file that does not come out of it, you can create it to avoid future exceptions. A lot depends on what you do. If you are debugging, it is always useful to use the stacktrace function.
Refer to javadoc
source share