22.3k views
5 votes
Explain what happens if you try to open a file for reading that does not exist.

User Honeal
by
6.8k points

1 Answer

7 votes

Answer:

Exception is thrown and the file is created with 0 length.

Step-by-step explanation:

While opening a file there is an error occur which shows the file does not exist that means an exception is thrown.

And this error can be occur when the size of the file is very very low means the file is a size of 0 length. So to avoid this error we have to exceed its length from the zero length.

User TomRichardson
by
6.5k points