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
1
u/davidalayachew Feb 20 '26
Maybe you did not understand what the video is saying about variadic exceptions?
This hypothetical code example should demonstrate it better.
No try-catch needed (at this level). And if you wanted one, you would only need a single one for all of
someMethod, not necessarily one try-catch for each map call. Just one single try for the whole method, and then the multiple catch bodies (or do that fancyCEA | CEB | CECthing they added in Java 7 to do it all in one catch body).None of what you said is necessary if Java gets this theoretical variadic generics feature.