Should the Java class IOException have been an unchecked RuntimeException?
Do you agree that the Java class java.io.creators IOException should have made it an unchecked run-time exception inherited from java. lang?
Instead of a checked exception generated solely from java.lang.Exception, why not use RuntimeException?
I believe that class IOException should have been an unchecked exception because an application can do nothing to fix problems like file system faults. However, Elliotte Rusty Harold says in When You May't Throw An Exception that most I/O faults are temporary and that you can retry an I/O operation numerous times before giving up:
Is this the situation in general? Is it possible for a Java program to repair I/O faults or must it wait for the system to recover? If this is the case, then IOException should be checked; otherwise, IOException should be unchecked so that business logic can transfer the processing of this exception to a separate system error handler.
Влезте в услугата, за да оставите коментар.