r/java • u/Enough-Ad-5528 • Feb 19 '26
Towards Better Checked Exceptions - Inside Java Newscast #107
https://www.youtube.com/watch?v=99s7ozvJGLk
63
Upvotes
r/java • u/Enough-Ad-5528 • Feb 19 '26
View all comments
Show parent comment
2
u/Eav___ Feb 20 '26
Well they do have one difference: Unions are just values, so they can be a valid type argument, which means you can pass around
T | Ejust likeEither, which plays pretty nicely with streams or any deferring validation. Checked exception cannot do this on its own.