Except Emil is talking about "Java exceptions", not "Java runtime exceptions".
Because Java's checked exceptions have the exact same good qualities that Rust's question mark operator offers.
Because Java's checked exceptions have the exact same good qualities that Rust's question mark operator offers.
Only if you want to catch (handle) it. If you don't want to do that, just declare it in your "throws" clause and enjoy writing your code with the (guaranteed) assumption that you are using a valid value.
> Furthermore, it is nigh impossible to rely on checked exceptions alone, most Java code may throw RuntimeExceptions such as NullPointerException or ArrayIndexOutOfBoundsException and there is no way to know it by just looking at the calling code.
That's a bug, not a feature. These errors are often unrecoverable, hence why they are runtime and not checked.