On Sat, 5 Apr 2025 02:30:33 GMT, Chen Liang <li...@openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/IO.java line 147:
>> 
>>> 145:         } catch (IOException ioe) {
>>> 146:             throw new IOError(ioe);
>>> 147:         }
>> 
>> Was `UncheckedIOException` considered? It might be better for beginners to 
>> learn throwing exceptions instead of errors.
>
> This implementation is not to be emulated by beginners. If an Exception.is 
> thrown here, a user might be tempted to add handlers in their code, while 
> this is an issue with the setup.

Someone is bound to ask why the readln method throw but the println methods 
don't.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24438#discussion_r2030830662

Reply via email to