87.8k views
0 votes
Why do most object-oriented programming languages mandate that I/O operations involving secondary storage such as disk are to be done in a try and catch block?

Working with localStorage is more efficient.
Working with try and catch blocks is faster.
Working with localStorage can result in errors.

1 Answer

4 votes

Answer: b) working with try and catch blocks is faster.

Step-by-step explanation:

using try and catch blocks when performing I/O operations involving secondary storage such as disk is important because it allows potential errors to be handled gracefully.

User Preet Singh
by
8.2k points